|
-
Oct 30th, 2000, 11:27 AM
#1
Thread Starter
Frenzied Member
Hi,
I'm using the following code to uncheck/check a check box:
Code:
Private Sub picBPCredit_Click()
'-- check/uncheck the checkbox
If chkBPCredit.Value = 0 Then
chkBPCredit.Value = 1
Else
chkBPCredit.Value = 0
End If
End Sub
I know the above code can be reduced to 1 or 2 lines but I forgot how to do it.. The reduced code reads something like: "value of check box not equal to current value of check.." or something like that but I just can't figure it out..
Any help would be appreciated..
Dan
-
Oct 30th, 2000, 11:35 AM
#2
transcendental analytic
chkBPCredit.Value = - not(-chkBPCredit.Value)
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 30th, 2000, 11:41 AM
#3
_______
<?>
chkBPCredit.Value = IIf(chkBPCredit.Value = 0, 1, 0)
"A myth is not the succession of individual images,
but an integerated meaningful entity,
reflecting a distinct aspect of the real world."
___ Adolf Jensen
-
Oct 30th, 2000, 11:53 AM
#4
transcendental analytic
Immediate if's are slow, i've heard
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 30th, 2000, 12:18 PM
#5
allmost the same as kedaman's, for some people maybe more readable:
chkBPCredit.Value = Abs(Not CBool(chkBPCredit.Value))
regards
Sascha
-
Oct 30th, 2000, 01:51 PM
#6
Frenzied Member
I try your code Kedaman cuz it's really short but it give me an error : Out of stack space.
Why and what is stack space??
-
Oct 30th, 2000, 02:08 PM
#7
transcendental analytic
Don't place it in chkBPCredit_Click, it will raise the same event over and over again until crashing.
If you click it will automatically check/uncheck
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 30th, 2000, 02:12 PM
#8
Frenzied Member
Oups!!!!
I really need some sleep
iiiihhaaaahh think i really need some sleep!
oup i just repeat myself
i think i ................
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|