Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums
Views: 1020 | Replies: 9
![]() |
•
•
Join Date: May 2007
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
i m new in VB
just self-learning..
if i wanna build a menu..
however, somewhere is highlight and seems wrong..
please help..
ck_chick.Value = 0 <--- is it wrong?
just self-learning..
if i wanna build a menu..
however, somewhere is highlight and seems wrong..
please help..
ck_chick.Value = 0 <--- is it wrong?
Option Explicit Private Sub Form_Load() Print "1" End Sub Private Sub Command1_Click(Index As Integer) Dim food1, food2, food3, food4 Dim drink As String Dim egg As String Dim subfood As String Dim ck_chick As Integer Dim ck_beef As Integer Dim ck_pork As Integer Dim ck_fish As Integer ck_chick.Value = 0 ck_beef.Value = 0 ck_pork.Value = 0 ck_fish.Value = 0 If ck_chick.Value = 1 Then food1 = "雞扒" End If If ck_beef.Value = 1 Then food2 = "牛扒" End If If ck_pork.Value = 1 Then food3 = "豬扒" End If If ck_fishValue = 1 Then food4 = "魚柳" End If If ck_chick.Value = 0 And ck_beef.Value = 0 _ And ck_pork.Value = 0 And ck_fish.Value = 0 _ Then MsgBox = "請選一款" End If End Sub Private Sub Command2_Click(Index As Integer) Form_Load End Sub Private Sub Command3_Click(Index As Integer) Unload Me End End Sub Private Sub Frame1_DragDrop(Source As Control, X As Single, Y As Single) ck_check1.Value = 0 ck_check2.Value = 0 ck_check3.Value = 0 ck_check4.Value = 0 End Sub Private Sub Frame2_DragDrop(Source As Control, X As Single, Y As Single) opt_option1.Value = False opt_option2.Value = False opt_option3.Value = False opt_option4.Value = False End Sub Private Sub Frame3_DragDrop(Source As Control, X As Single, Y As Single) opt_option5.Value = False opt_option6.Value = False opt_option7.Value = False End Sub Private Sub Frame4_DragDrop(Source As Control, X As Single, Y As Single) opt_option8.Value = False opt_option9.Value = False opt_option10.Value = False End Sub
•
•
Join Date: Mar 2007
Location: Pearl of the Orient Seas
Posts: 181
Reputation:
Rep Power: 2
Solved Threads: 3
•
•
Join Date: May 2007
Location: Warrington, England
Posts: 31
Reputation:
Rep Power: 2
Solved Threads: 2
You Say Something SEEMS Wrong. Did You Get A Runtime Error ? If So, What Was It.
It's Been A While Since I Did Any VB, So Someone Will Correct Me If I'm Wrong.....
There's Nothing Wrong With ck_chick.Value = 0. Check Boxes, Radio Buttons And A Host Of Other Controls (If Not All !) Have A Default Field That VB Assumes. Most Of The Time It Is The .Value Field. If You Just Use ck_chick = 0 Or opt_option1 = False, Then This Is Fine.
It's Been A While Since I Did Any VB, So Someone Will Correct Me If I'm Wrong.....
There's Nothing Wrong With ck_chick.Value = 0. Check Boxes, Radio Buttons And A Host Of Other Controls (If Not All !) Have A Default Field That VB Assumes. Most Of The Time It Is The .Value Field. If You Just Use ck_chick = 0 Or opt_option1 = False, Then This Is Fine.
•
•
Join Date: Mar 2007
Location: Pearl of the Orient Seas
Posts: 181
Reputation:
Rep Power: 2
Solved Threads: 3
•
•
•
•
You Say Something SEEMS Wrong. Did You Get A Runtime Error ? If So, What Was It.
It's Been A While Since I Did Any VB, So Someone Will Correct Me If I'm Wrong.....
There's Nothing Wrong With ck_chick.Value = 0. Check Boxes, Radio Buttons And A Host Of Other Controls (If Not All !) Have A Default Field That VB Assumes. Most Of The Time It Is The .Value Field. If You Just Use ck_chick = 0 Or opt_option1 = False, Then This Is Fine.
ck_chick is an integer. An error appears when ".value" is added to assign a value to integers and others such.
I think he means that the ck_chick.value = 0 is highligted when the error appears.
There are 10 types of people: those who understand Binary and those who don't!
•
•
Join Date: May 2007
Posts: 3
Reputation:
Rep Power: 0
Solved Threads: 0
oops... thanks all!!
i have tried the above suggestion....
but i dunno why it does not work still....
there may be other incorrect configuration..?!...
it makes me wanna give up..
http://www.profsr.com/vb/vbless04.htm
I've followed this link, the tutorial online taught to add .value
actually, i tried to type the same as the tutorial sample..
"Private sub command1()" <---- this line are always highlight with yellow color..
should i add some declaration inside the ()?
or add "Dim chick as Integer" <--- after?
is there any better online tutorial about VB for the beginners??
i wanna first attempt to make a menu with several check boxes ..
^___^" thank you for paying attention on my post...
i have tried the above suggestion....
but i dunno why it does not work still....
there may be other incorrect configuration..?!...
it makes me wanna give up..
http://www.profsr.com/vb/vbless04.htm
I've followed this link, the tutorial online taught to add .value
actually, i tried to type the same as the tutorial sample..
"Private sub command1()" <---- this line are always highlight with yellow color..
should i add some declaration inside the ()?
or add "Dim chick as Integer" <--- after?
is there any better online tutorial about VB for the beginners??
i wanna first attempt to make a menu with several check boxes ..
^___^" thank you for paying attention on my post...
•
•
Join Date: Mar 2007
Location: Pearl of the Orient Seas
Posts: 181
Reputation:
Rep Power: 2
Solved Threads: 3
•
•
Join Date: May 2007
Posts: 31
Reputation:
Rep Power: 2
Solved Threads: 0
vb Syntax (Toggle Plain Text)
Unload Me
If you use Unload Me and there is only one form open then it will close the project though.
Then i guess in the Form_Unload event of the form you could close all other forms by simply...
vb Syntax (Toggle Plain Text)
Unload Form2 Unload Form3
Last edited by ~Paul~ : May 25th, 2007 at 4:26 am. Reason: fixed
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)





Linear Mode