|
-
Jun 18th, 2000, 04:30 PM
#1
Thread Starter
Hyperactive Member
I have a list of customers i would like to enable if ans when needed. When checked i would like the string to return who i have selected.. can anyone tell me the best option to use in VB.?
-
Jun 18th, 2000, 05:45 PM
#2
Fanatic Member
Hi there gsc1ugs,
What do you want ??? The code or the logic ???
Both the logic and code, you should specify more I think. Because, I only got this from your msg,...
You got a list, let's say like this :
- Customer I
- Customer II
- Customer III
- Customer IV
and then you have a checkbox like this...
Enable List ???
if user check the checkbox, then, the list of customer will enabled. If user uncheck the checkbox, the list of customer will disabled.
If user check the checkbox, and then choose Customer II, then there will be message / string to show that you choose customer II.
Am I right ???
If so, let me know ASAP
Cheers ,
Wen Lie
[Edited by Wen Lie on 06-19-2000 at 06:51 AM]
-
Jun 18th, 2000, 06:07 PM
#3
Thread Starter
Hyperactive Member
check boxes
-
Jun 18th, 2000, 07:03 PM
#4
Thread Starter
Hyperactive Member
check boxes
hOW DO YOU DO THIS.. DO YOU HAVE AN EXAMPLE
-
Jun 18th, 2000, 07:31 PM
#5
Fanatic Member
Well then, try this
In a form at design time, place the listbox and checkbox.
Let's say that the listbox name is lstBox, and the checkbox name is chkBox.
First, at form load, add your list name of customer.
Code:
Private Sub Form_Load()
For iLoop = 1 to MaxLst
lstBox.AddItem your item goes here
Next iLoop
lstBox.Enable = False
End Sub
Then at chkBox_Click Event, write this code :
Code:
Private Sub chkBox_Click()
If chkBox.Value = 1 Then
lstBox.Enable = True
Else
lstBox.Enable = False
End If
End Sub
Then at lstBox_Click Event, write your msg :
Code:
Private Sub lstBox_Click()
Dim Msg
'cek the index of lstBox clicked item.
'then write :
Msg = lstBox.List(lstBox.ListIndex)
End Sub
Hope will help you...
And hope will not get any error, coz I make this in sleepy eyes... 
BRgds,
Wen Lie
-
Jun 18th, 2000, 11:52 PM
#6
Thread Starter
Hyperactive Member
check boxes
This does'nt really answer my dilema.. i read from a database (i should have told you this) and if the customer read from the database is equal to the check box then do something,, thats my scenario..?
Many thanks
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
|