[Tutorial] Make Forms Prettier

Posts 1–14 of 14 · Page 1 of 1
[Tutorial] Make Forms Prettier
This is a tutorial on how to make your forms prettier without the use of special UI
Textboxes
Password Textboxes
1. Make a Textbox
2. Goto properties and look for "Passwordchar"
3. Set that to * or ●
Different Text Font/Color Textboxes
1. Make a Textbox
2. Goto properties and look for "Font"
3. Click the "..." and change the font and text size
4. Look right below it and you will see "Forecolor"
5. Change that to the color you wish the text to be
Textboxes that change when you click them
1. Double click on your textbox
2. replace the code it just generated with this one
Code:
    Private Sub TextBox1_MouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles TextBox1.MouseClick 'This was copied and pasted from Treeham
'Insert Code Here
    End Sub
3. Note the "TextBox1_MouseClick"
Buttons
Change the button entirely
1. Make a button on your form
2. Delete the text in the button (optional)
3. goto mspaint and make a pretty button
4. goto properties and look for "Flatstyle" and "Image" and "Flatappearance"
5. Change "Flatstyle" to Flat and "Image" to whatever image you just made
6. Open up "Flatappearance" and change "Bordersize" to 0
Forms
Style
1. Click your form
2. Goto properties, and look for "Borderstyle"
3. Now change this to "SizableToolWindow"
Changing Form Text
1. Make a timer
2. Set it to enabled, and the interval to 1000
3. Open up the timer's code and put in:
3.5. Make a global integer "x" and set it to 0
Code:
If x = 0 Then
Me.Text = "Treeham is cool"
x += 1
ElseIf x = 1 Then
Me.Text = "Treeham is the best"
Else if x = 2 Then
Me.Text = "Treeham says you can add more if you want"
x = 0 'Just remember to set it to 0 to have it loop
End If
Backgrounds
1. Click your form
2. Look for "Backgroundimage" or "Backcolor"
3. Change those, not too hard "backgroundimage" changes the background to an image and "Backcolor" changes the background color
End
Here is the final result:


I'm open to suggestions to put on here
I didn't know this, good job .

Nice tutorial. And thanks :P.

EDIT: I skimmed it, i only didn't know the form one, only thing i knew about that was what Xplicitt told me. Custom ski or w/e.
i think nextgen's is better
sorry :/
Quote Originally Posted by mnpeepno2 View Post
i think nextgen's is better
sorry :/
Thats custom UI
This is sticking with the old System.Windows.Forms.Form UI
I have the timer enabled, and i put the text i want for Me.Text, but it doesn't seem to change the text. I made an integer too.

[php] Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim x As Integer
If x = 0 Then
Me.Text = "MugNuf's and Samueldo's"
x += 1
ElseIf x = 1 Then
Me.Text = "Multitool"
ElseIf x = 2 Then
Me.Text = "Visit http://www.mpgh.net/ now!"
x = 0
End If
End Sub[/php]

Er.. Help...?
Quote Originally Posted by MugNuf View Post
I have the timer enabled, and i put the text i want for Me.Text, but it doesn't seem to change the text. I made an integer too.

[php] Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim x As Integer
If x = 0 Then
Me.Text = "MugNuf's and Samueldo's"
x += 1
ElseIf x = 1 Then
Me.Text = "Multitool"
ElseIf x = 2 Then
Me.Text = "Visit http://www.mpgh.net/ now!"
x = 0
End If
End Sub[/php]

Er.. Help...?
[php] Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

Dim x As Integer = 0
x = x + 1
If x = 0 Then
Me.Text = "MugNuf's and Samueldo's"
ElseIf x = 1 Then
Me.Text = "Multitool"
ElseIf x = 2 Then
Me.Text = "Visit http://www.mpgh.net/ now!"
x = 0
End If
End Sub[/php]

You forgot to add x=x+1, and I just made it simpler.
Quote Originally Posted by Lolland View Post
[php] Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

Dim x As Integer = 0
x = x + 1
If x = 0 Then
Me.Text = "MugNuf's and Samueldo's"
ElseIf x = 1 Then
Me.Text = "Multitool"
ElseIf x = 2 Then
Me.Text = "Visit http://www.mpgh.net/ now!"
x = 0
End If
End Sub[/php]

You forgot to add x=x+1, and I just made it simpler.
Dang your good at VB xD.

Did you teach yourself or read books? Hm, I'm still learning.
Quote Originally Posted by MugNuf View Post
Did you teach yourself or read books? Hm, I'm still learning.
I'm learning VB in school. We have a textbook-type thing.
Code:
 Dim x As Integer = 0
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If x = 0 Then
            Me.Text = "MugNuf's and Samueldo's"
            x = x + 1
        ElseIf x = 1 Then
            Me.Text = "Multitool"
            x = x + 1
        ElseIf x = 2 Then
            Me.Text = "Visit http://www.mpgh.net/ now!"
            x = 0
        End If
    End Sub
This code makes more sense.
Quote Originally Posted by treeham View Post
Code:
 Dim x As Integer = 0
    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        If x = 0 Then
            Me.Text = "MugNuf's and Samueldo's"
            x = x + 1
        ElseIf x = 1 Then
            Me.Text = "Multitool"
            x = x + 1
        ElseIf x = 2 Then
            Me.Text = "Visit http://www.mpgh.net/ now!"
            x = 0
        End If
    End Sub
This code makes more sense.
Yeah but it's more complex.

If I were to hand in a project with this code, I'd get 10% taken off because I could've used a simpler code.

Simplicity always wins.
Quote Originally Posted by Lolland View Post
Yeah but it's more complex.

If I were to hand in a project with this code, I'd get 10% taken off because I could've used a simpler code.

Simplicity always wins.


Yours:
Code:
Dim x As Integer = 0
x = x + 1
        If x = 0 Then
            Me.Text = "MugNuf's and Samueldo's"
        ElseIf x = 1 Then
            Me.Text = "Multitool"
        ElseIf x = 2 Then
            Me.Text = "Visit http://www.mpgh.net/ now!"
            x = 0
        End If
    End Sub
Mine:
Code:
x += 1
        Select Case x
            Case 1
                Me.Text = "MugNuf's and Samueldo's"
            Case 2
                Me.Text = "Multitool"
            Case 3
                Me.Text = "Visit http://www.mpgh.net/ now!"
                x = 0
            Case Else
                'x = 0 'This will show "Visit http://www.mpgh.net/ now!" 1 second longer.
        End Select
Dim x as integer 'No need for = 0 because it's 0 by default.
x += 1
Both do the same thing on different ways.
It doesn't matter if something has the same outcome,

A. Simplicity in code is Key, If you can accomplish something with less code, do it

B. Sometimes more code is required to perform a professional task, at that is a exception
What is simpler:

Code:
ElseIf x = 2 Then
'Code
Code:
Case 2
'Code
You are reading into what I said a little to "exact", I was making a general statement.

Each design requires a different approach and different codes.

Here is an example as mentioned, VS Comes pre-built with software generated auto updates , yet you have the ability to add it to your code, and for what? Let VS generate the code for you, it's easier and cleaner.

A Leecher: Copy and pastes code and asks for help in every aspect to get it to work.
A New coder Combines leeching, support and basic knowledge to achieve a suitable outcome
A good coder creates projects by themselves that work
A professional coder not only creates the code and makes it functional, but keeps the code neat and the tasks completed in as little code as possible.

Some tasks can be completed in 5 lines of code, but may take someone someone else with alittle more experience, two lines of code, or no code at all.


Now we end this discussion, this thread has been hijacked by discussing opinions in code, that's a whole new thread topic.

This isn't a thread about "Simple Coding"
Posts 1–14 of 14 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us