|
-
Jun 3rd, 2001, 09:19 AM
#1
How do i check all of the checks except the one i clicked
Hi,
i have 5 checks, what i want to do is like this;
when i click on a check, all of the checks goes to value=2 except the one i clicked and it becomes value=1. if i click on a different one then it's the same, all go 2 except the new one i clicked..
i don't want to use long messy codes and i keep getting my self into loops, so is there a quick and easy way to do this..?
thanks..
-
Jun 3rd, 2001, 09:27 AM
#2
Frenzied Member
why not use radio buttons.
-
Jun 3rd, 2001, 09:39 AM
#3
Addicted Member
Called Option buttons these days
-
Jun 3rd, 2001, 09:42 AM
#4
Frenzied Member
Try this
Do not use VbGrayed, because what happens is that the click event will fire again. Hope this helps.
Code:
Private Sub Check1_Click(Index As Integer)
Dim iChkIndex As Integer
iChkIndex = Index
For i = 0 To Check1.UBound
If Check1.Item(i).Index = iChkIndex Then
Check1.Item(i).Value = vbChecked
Else
Check1.Item(i).Enabled = False
End If
Next
End Sub
-
Jun 3rd, 2001, 09:44 AM
#5
Addicted Member
i'd make them an array...
check(0)
check(1)
check(2)
check(3)
check(4)
then when you click one
Code:
Option Explicit
Dim Checking As Boolean
Private Sub Check_Click(Index As Integer)
If Checking = True Then Exit Sub
Checking = True
Dim x As Integer
For x = Check.lbound To Check.ubound
If x <> Index Then
Check(x).Value = 1
Else
Check(x).Value = 0
End If
Next
Checking = False
End Sub
-
Jun 3rd, 2001, 09:49 AM
#6
Frenzied Member
Vb.net called Radio buttons. jejeje
Originally posted by stevess
Called Option buttons these days
-
Jun 3rd, 2001, 10:57 AM
#7
Radio Button is the correct term. Likewise, Static is the correct term for a PictureBox.
-
Jun 3rd, 2001, 11:04 AM
#8
Frenzied Member
Is there any Options in the programming world anymore. If microsoft can rename everything just to remarket something why can't we. jejejej Thx Megatron.
-
Jun 3rd, 2001, 11:07 AM
#9
Addicted Member
In VB 5 and 6, they are called Option Buttons, the TypeOf the control is OptionButton. The default name is Option1.
I don't care what they are called, but if someone who is just starting in VB trys to find a Radio Button control they will have a hard time, since it doesn't exist.
"radio Button is the correct term", based on what?
-
Jun 3rd, 2001, 11:12 AM
#10
Frenzied Member
Every other language out there has called them radio buttons for the longest. Microsoft just renamed their Option Button to Radio button in the new version of vb. Vb.net was also redesigned to attract the c programers as well as the existing vb programmers. So guess what the now are more standardize. I know what you mean stevess, but if i was to say radio button to you, would you know what i mean? I think you would. It seems that when someone starts off with vb, they think MS rules the world, but that is not true. Yeah they have created a monster of a new vb version and i will continue to use it for its power in RAD. And because it's the most used language out there. I think there is a thread out there about this issue, but i will not go into any further.
-
Jun 3rd, 2001, 11:15 AM
#11
VB changes the names of many controls
Option button = Radio Button
CommandButton = Push Button
PictureBox/Label/Image = Static
Frame = Group Box
TextBox = Edit
RichTextBox = RichEdit
-
Jun 3rd, 2001, 11:23 AM
#12
Addicted Member
I would know, but based on the original question I didn't think bzemer would. I only made my original statement so that he would know what to look for
This is a "VB" forum that attracts mostly beginners who don't know anything about other languages or that MS renamed the controls.
I was just trying to save him some time. I thought it was likely that he would not have any idea what a radio button was
-
Jun 3rd, 2001, 11:30 AM
#13
Frenzied Member
It's all kewl, but guess what he now knows. One converstaion spawns another, and that is half the battle is won.
-
Jun 3rd, 2001, 05:14 PM
#14
-
Jun 3rd, 2001, 09:03 PM
#15
Megatron,
Static windows show images??
I didn't know that.
Also, labels aren't really windows at all. They might imitate the static window, but they aren't renamed static windows. Or did you just mean that they imitate static windows?
-
Jun 3rd, 2001, 09:08 PM
#16
Frenzied Member
Man Microsoft really causes havoc when ever they rename things or use name for other things. Like in the case of COM+ it's just a hyped up MTS with a new name.
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
|