Hi,
This is my first post and i'm quite new to VB2005 so hopefully i'll explain what i'm after properly.
Basically i'm creating a single contextmenu for each of the text boxes I have on a form. Most of the contextmenu will be populated with text which when the user selects it, is set in the textbox which used the contextmenu.
Now I can do the contextmenu, thats fine and populate it with the data, the problem i'm having is telling the textbox to display the text the user has selected on the contextmenu.
I'm using sourcecontrol to find out which textbox fired the contextmenu but once one of the items is selected nothing is displayed in the textbox. I have also tried it with a msgbox to try and see whats going on but nothing is displayed in that also.
Here's a quick sample to show what i'm trying to do:
What I would eventually like to do is write just one function which finds which textbox fired the contextmenu and then set its text to that of the chosen menuitem on the contetmenu.Code:Private Sub ContextMenuStrip_click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ContextMenuStrip.Click If ContextMenuStrip.SourceControl Is TextBox1 Then TextBox1.Text = ContextMenuStrip.Text ElseIf ContextMenuStrip.SourceControl Is TextBox2 Then TextBox2.Text = ContextMenuStrip.Text End If End Sub
I really appreciate any help someone can give me.
MadCat


Reply With Quote
Bookmarks