Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

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


  • Please log in to reply

#1
rtc_18m

rtc_18m

    Member

  • 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

Advertisements


#2
darth_ash

darth_ash

    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:
0-Unchecked
1-Checked
2-Greyed
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.


Consider:
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

#3
PANCAK3

PANCAK3

    Member

  • 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