Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

hlp with reply post links n e thing plz n e one

  • Please log in to reply




  • Member
  • PipPip
  • 13 posts
I have VB 6 now and i follow tutorials and im rly good at building the interface but i mean who wouldnt b right? but when it comes to the codes i dont understand i mean Private Sub chkItalic_Click()
If chkItalic.Value = 1 Then ' If checked.
txtDisplay.FontItalic = True
Else ' If not checked.
txtDisplay.FontItalic = False
End If
End Sub
i was told that in a tutorial and whats it all mean? from each lil word to it all? i understand a lil bit but does it mean IF the italic is checked the display the txt in italic thats what it says but whats the chkItalic.Value mean? and how will i kno exactly what code to type with what? can anyone hlp me with links ur own opinions or n e thing? i rly wanna learn 4 myself to show myself and others i can do it i dont wanna have to copy and paste all bc its not rly me doing the work so anyone plz hlp me plzzzzzz
  • 0




    Member 1K

  • Member
  • PipPipPipPip
  • 1,382 posts
Hi rtc_18m,
Firstly, VB is a event-driven programming language., which means that a block of code is executed on occurence of an event.

Now, lets look at the following line:
Private Sub chkItalic_Click()
Sub means this block of code is a procedure; it is important to note the difference between a Function and a Sub, a Functions returns a value while a Sub does'nt.
chkItalic is the name of your check-box.
Private means that this procedure is local only to the current form\module, so this procedure can't be used by other forms\modules.
"..._Click" signifies a click event.
In all, this is local procedure which is called when someone clicks on the chkItalic check-box.

Now since the user has clicked on the check-box and we have entered aforementioned procedure, consider only these lines:
If chkItalic.Value = 1 Then 
txtDisplay.FontItalic = True
We now need to find, whether the check-box is checked(ticked) or not. This is the stored in the property for check-boxes called Value, below are the possible values of Value:
We want to change the text in italics, only when the chkItalic check-box is checked(ticked)
FontItalic is a property for text-boxes, which when True, changes the text in the tex-box to italics.

Else ' If not checked.
txtDisplay.FontItalic = False
This is the code that is executed, if the check-box was unchecked(unticked) at the time of clicking on it. This is the exact opposite of the above set of statements, we need to un-italize the text in the text-box, if the chkItalic check-box is unchecked(unticked).
  • 0




  • Member
  • PipPipPip
  • 125 posts
wow...a thorough explaination... *thumbs up*
  • 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP