|
-
Aug 2nd, 2002, 10:48 AM
#1
Thread Starter
New Member
I need help with context menu
What I have in my project:
01 btnphone
01 context menu 2 items (phone,mobile)
associated to btnphone
01 textBox (txtPhone)
==============
Private btnphoneContextMenu As ContextMenu
Private Sub btnphone_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If btnphoneContextMenu Is Nothing Then
btnphoneContextMenu = New ContextMenu()
With btnphoneContextMenu
.MenuItems.Add("Phone Home", AddressOf ButtonMenuHandler)
.MenuItems.Add("Phone work", AddressOf ButtonMenuHandler)
End With
Button1.ContextMenu = btnphoneContextMenu
End If
End Sub
Private Sub ButtonMenuHandler(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim item As MenuItem
item = CType(sender, MenuItem)
'//NOW I AM LOST
End Sub
===================
I have and address book user inputs Name,surname,City etc....
now when user gets to the type in the phone number,they
write the phoneNumber in the txtphone.text and
then press btnphone and the context menu appear
toogle the menu items the associated number must appear in the
txtphone.text and persist in a variable.
so that i can later save them .
I HAVE ASSOCIATED THE MENU WITH A BTN BUT I AM LOST
WHEN I HAVE TO PERSIST THE PHONE NUMBERS SOMEWHERE
SO THAT THE USER CAN TOOGLE THE MENU ITEMS AND THE ASSOCIATED PHONE NUMBER WILL APPEAR.
Can you help me with a small example .?
Getting crazy here
thanks a lot anyway.
Gabriel
Thanks for your help and suggestion
Gabriel
-
Aug 2nd, 2002, 11:41 AM
#2
Frenzied Member
Hey welcome to the forum. For future reference, when posting code use the tags, you'll get a lot more response that way. I 'll to figure out something and post it later.
Dev
-
Aug 2nd, 2002, 01:32 PM
#3
yay gay
VB Code:
Private btnphoneContextMenu As ContextMenu
Private Sub btnphone_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If btnphoneContextMenu Is Nothing Then
btnphoneContextMenu = New ContextMenu()
With btnphoneContextMenu
.MenuItems.Add("Phone Home", AddressOf ButtonMenuHandler)
.MenuItems.Add("Phone work", AddressOf ButtonMenuHandler)
End With
Button1.ContextMenu = btnphoneContextMenu
End If
End Sub
Private Sub ButtonMenuHandler(ByVal sender As System.Object, ByVal e As System.EventArgs)
Dim item As MenuItem
item = CType(sender, MenuItem)
'//NOW I AM LOST
End Sub
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
|