|
-
Sep 3rd, 2002, 12:55 AM
#1
Thread Starter
Lively Member
RESOLVED: want my checkbox to uncheck when context menu appears
when my context menu (which comes up when right-clicking on my checkbox) pops up, i want the checkbox to be unchecked. so i have this code for my context menu:
Code:
Private Sub RightClick_Popup(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RightClick.Popup
sender.checked = False
End Sub
but when my program is run i get this this error: Public member 'checked' on type 'Context Menu' not found.
why isn't this working? what can i do to make this work?
Thanks.
Last edited by Psychotron; Sep 5th, 2002 at 08:43 AM.
-
Sep 3rd, 2002, 03:44 AM
#2
Member
maybe this works...
Instead of sender.checked try chkboxname.checked = false
Dozo
-
Sep 3rd, 2002, 04:29 AM
#3
Because "Checked" is not a property of "Object".
You could cast it to a Checkbox first though.
(not tested but should work)
Dim MyCheckBox as Checkbox
MyCheckBox = CType(sender, Checkbox)
MyCheckbox.Checked = False
-
Sep 5th, 2002, 12:24 AM
#4
Thread Starter
Lively Member
this didn't work. this time it said 'specified cast is not valid.'
so does than mean i can't cast it to a checkbox? can i cast it to something else then?
-
Sep 5th, 2002, 01:02 AM
#5
Is RightClick your popup menu?
In that case sender would be the popup menu and not the checkbox.
Try this:
sender.sourcecontrol.checked = True
-
Sep 5th, 2002, 08:40 AM
#6
Thread Starter
Lively Member
resovled
that did the trick! 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
|