Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[PICTURE TUTORIAL] VB2008 - Properties

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
OSIRIS
Grandmaster Cheater
Reputation: 0

Joined: 27 Aug 2006
Posts: 654

PostPosted: Sun Mar 09, 2008 8:15 pm    Post subject: [PICTURE TUTORIAL] VB2008 - Properties Reply with quote

To make your first form
This is fairly easy. File>New Project Now name it and hit OK


Properties
Every single thing in Visual Basic has properties. There are 2 ways of editing properties.

1) Desinger
2) Code

1- Designer

This is really easy. For example modify the text area to Hello. Then form1 will now be titled Hello. Play around with these as you should know some of them before continuing.



2- Code

This is were you would modify the code of the the app to modify properties. For an example form1 is the name is the main window. If you would want to change it to hello using code you use this.




Your first application.

So now if you where playing around with any thing create a new project. Now place a button and a label there.Resize the corners to make it look good It should look something like this.

Double click on the button to go its code. There should be something looking like this.
Code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

    End Sub

What our goal is, when you hit button1 the label will change to Hello. So remember how everything has a property. So do labels. So when we hit button1 we want this to happen.
Code:

label1.text=("Hello")

So now put that inside the code that was already there and you get.
Code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
label1.text=("Hello")
    End Sub

Run your program by pushing F5 and click the button. The label should now change to Hello.




More advanced

Now keep everything the same way it is. Except add a text box onto the form. It should now look like this.

Now our goal is to. When button1 is pressed the text that is inside textbox1 will be displayed into label1. So basically where taking textbox1.text and puttting it to label1.text. So now modify your code to look like this.
Code:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
label1.text=textbox1.text
    End Sub

Run it, so now what ever is in the textbox goes to the label.


You just got to remember that everything has a property, the most comonly used one is text. Just enter the object names then .text. Example.
combobox1.text
label2.text
webbrowser1.text
listbox1.text

There are also properties such as BackColor this is the background color of the object. So now make a new button. And in the code enter this.
Code:

Me.BackColor = Color.Aquamarine

You can't use
Form1.BackColor = Color.Aquamarine
becuase form1 cant refer to its self so instead we would use Me.



So this concludes my quick tutorial. There are so many properties out there for you explore are get experinced with.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites