| View previous topic :: View next topic |
| is this a noobie question??? |
| yes |
|
0% |
[ 0 ] |
| no |
|
100% |
[ 1 ] |
|
| Total Votes : 1 |
|
| Author |
Message |
lolium Expert Cheater
Reputation: 0
Joined: 16 Jun 2007 Posts: 209 Location: AREA 51!!!!!!!!!!!!!!!!!!!!
|
Posted: Fri Nov 23, 2007 4:12 pm Post subject: [Question] how to do something |
|
|
how do u make it in vb6 so a command button won't work unless a check box is checked have a look at screenie
| Description: |
|
| Filesize: |
136.72 KB |
| Viewed: |
8583 Time(s) |

|
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Nov 23, 2007 4:26 pm Post subject: |
|
|
don't really know the exact syntax, but it applies all the same
| Code: | if (checkBox1.Checked = true)
button1.Enabled = false
else
button1.Enabled = false |
Last edited by hcavolsdsadgadsg on Fri Nov 23, 2007 4:37 pm; edited 2 times in total |
|
| Back to top |
|
 |
Symbol I'm a spammer
Reputation: 0
Joined: 18 Apr 2007 Posts: 5094 Location: Israel.
|
Posted: Fri Nov 23, 2007 4:28 pm Post subject: |
|
|
Huh... I dunno in vb but should be something like:
| Code: | | if CheckBox1.Checked = true then Button1.Enabled := true else Button1.Enabled := false; |
Thats how it is in delphi.
Edit: someone else answered you...
|
|
| Back to top |
|
 |
lolium Expert Cheater
Reputation: 0
Joined: 16 Jun 2007 Posts: 209 Location: AREA 51!!!!!!!!!!!!!!!!!!!!
|
Posted: Fri Nov 23, 2007 4:31 pm Post subject: |
|
|
| it odesnt work for me is it supposed to be under the button code because that's were i put it
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Nov 23, 2007 4:33 pm Post subject: |
|
|
| lolium wrote: | | it odesnt work for me is it supposed to be under the button code because that's were i put it |
no, you want the checkbox to control the button, so it would be under the checkboxes code.
and don't trust it being perfectly correct. i don't know vb's syntax
|
|
| Back to top |
|
 |
lolium Expert Cheater
Reputation: 0
Joined: 16 Jun 2007 Posts: 209 Location: AREA 51!!!!!!!!!!!!!!!!!!!!
|
Posted: Fri Nov 23, 2007 4:38 pm Post subject: |
|
|
ok ty for help but it doesnt work for me tried editing it a little to try get it to work but still no luck
edit: duz this help at all
| Description: |
|
| Filesize: |
89.77 KB |
| Viewed: |
8551 Time(s) |

|
|
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Fri Nov 23, 2007 5:01 pm Post subject: |
|
|
Try this
| Code: | If check1.value = "1" Then
'do action
End If |
_________________
|
|
| Back to top |
|
 |
TheSorc3r3r I post too much
Reputation: 0
Joined: 06 Sep 2006 Posts: 2404
|
Posted: Fri Nov 23, 2007 5:22 pm Post subject: |
|
|
Just set the button to disabled by default then on CheckBox_Click() enable it.
_________________
Don't laugh, I'm still learning photoshop! |
|
| Back to top |
|
 |
lolium Expert Cheater
Reputation: 0
Joined: 16 Jun 2007 Posts: 209 Location: AREA 51!!!!!!!!!!!!!!!!!!!!
|
Posted: Fri Nov 23, 2007 5:28 pm Post subject: |
|
|
what is the code for it
TheSorc3r3r
and were do i put your code Blader
|
|
| Back to top |
|
 |
Pseudo Xero I post too much
Reputation: 0
Joined: 16 Feb 2007 Posts: 2607
|
Posted: Fri Nov 23, 2007 5:30 pm Post subject: |
|
|
You don't know VB at all, do you?
_________________
| haxory' wrote: | can't VB do anything??
windows is programmed using VB right? correct me if im wrong.
so all things in windows you have like the start menu is a windows form too. |
|
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Fri Nov 23, 2007 5:33 pm Post subject: |
|
|
Lol..
Put it under your click
So when you click the button, and the check box isin't checked, it won't do anything
When it is checked, it does the action
So you can test it by using this as an action
Form1.Hide
Don't check the box, and press the button, it should do nothing
Then try it with the check, and it should hide the form
_________________
|
|
| Back to top |
|
 |
lolium Expert Cheater
Reputation: 0
Joined: 16 Jun 2007 Posts: 209 Location: AREA 51!!!!!!!!!!!!!!!!!!!!
|
Posted: Fri Nov 23, 2007 6:26 pm Post subject: |
|
|
nope i dont no nutin bout vb an blader could u explain simpler
_________________
|
|
| Back to top |
|
 |
Blader I post too much
Reputation: 2
Joined: 19 Jan 2007 Posts: 2049
|
Posted: Fri Nov 23, 2007 6:30 pm Post subject: |
|
|
Even more SIMPLER? -.-....
It's soo easy to understand jeez
Ok, place a button and check box onto a form, got that?
Good, now double-click the button you have just made, and insert this code
| Code: | If check1.value = "1" Then
form1.hide
End If |
Ok, now you are done
form1.hide = Hides/Closes the window
So, if you dont check the box, it won't be enabled, but if you do, and press the command button, it will hide the window
UNDERSTAND?
_________________
|
|
| Back to top |
|
 |
TheSorc3r3r I post too much
Reputation: 0
Joined: 06 Sep 2006 Posts: 2404
|
Posted: Fri Nov 23, 2007 6:37 pm Post subject: |
|
|
lol why are you trying to program in it if you don't know it
_________________
Don't laugh, I'm still learning photoshop! |
|
| Back to top |
|
 |
lolium Expert Cheater
Reputation: 0
Joined: 16 Jun 2007 Posts: 209 Location: AREA 51!!!!!!!!!!!!!!!!!!!!
|
Posted: Fri Nov 23, 2007 8:41 pm Post subject: |
|
|
| ok thanks ill + rep u
|
|
| Back to top |
|
 |
|