.NET Framework - context Menu
Asked By msnews.microsoft.com
09-Feb-10 02:47 PM
Hello
I have a Inherited Text Box
I have Created a ContextMenu() for the class
Now when i Use the Text box in the Code
I can Add items to the Context Menu
When i Show the form and Textboxes all is fine
even when i right click the text box and i do see my option....
The Problem i having is i have 6 Textboxes Representiong 6 Different
Physical Drive or unc Paths on the network
so when im in the ContextMenu Event , I Cant See which TextBox Control owns
this specific Context Menu
Any Help
thank you
TextBox
(1)
Control
(1)
Show
(1)
Box
(1)
SourceControl
(1)
ContextMenu
(1)
ItThank
(1)
SirDid
(1)
Joe Cool replied to msnews.microsoft.com
ns
Did you try the SourceControl property?
msnews.microsoft.com replied to Joe Cool
Thats It
Thank you very much Sir
Did you try the SourceControl property?
Joe Cool replied to msnews.microsoft.com
This question has been asked and answered several times in this
newsgroup. Try a search first next time.
Usercontrol que referencia un control externo .NET Framework Hola, quiero hacer un user control que contenga botones, para que esos botones interactuen con un textbox que no forma parte del user control. Esto es hay un form, en el cual hay varios textbox, y se a = F1adir = E1 un usercontrol con los botones. Pues bien, esos botones, interactuan con UN textbox, para saber cual, he creado una propiedad en el user control con donde se indica el nombre del textbox con el que interactua (mitextbox) Bien, ahora desde mi usercontrol, por c = F3digo quiero definir
Multi-Dimentional Control Arrays And A Problem .NET Framework Copy and paste this into the code of a Handles MyBase.Click TextCounter + = 1 'Increase the counter for identification purposes. Dim txtText As New TextBox ' Declare a new TextBox. Me.Controls.Add(txtText) ' Add the TextBox to the form's Controls collection. With txtText .Top = 20 * TextCounter 'Offset the TextBox vertically. .Left = 20 * TextCounter 'Offset the TextBox horizontally. .Width = 50 'Set the TextBox's width. .Visible = True 'Make it seen by the user. .Tag = Str(TextCounter) 'The Tag the old "Index" property (e.g. TextCounter = 4, Tag = " 4"). 'This method allows for multidimentional control arrays 'limited only by the length of the Tag property. 'Example: txtText.Tag = " 1024 23
The only difference between these two project is that in one we have a simple TextBox and in the other we have a user control where we use the TextBox in this user control. In the project where two way binding works I have this code see below and as you can see I just changed this row textBox.DataBindings.Add("Text", thisPlayer, "Name"); to this row textBox.DataBindings.Add("Text", thisPlayer, "Name", true, DataSourceUpdateMode.OnPropertyChanged); So here I enter a name in a DataGridView cell push the enter key and the name is displayed in the TextBox. Now I can change the name in the TextBox and push the enter key and the name is changed in the DataGridView cell. Now
following steps is that I follow. 1.Click on the BtnCreateTextBox. This will create a TextBox and put this into the panel control. This works fine. 2.Enter a name into the DataGridView. 3.Click on the BtnBindToTextBox This should display the entered name in the created TextBox. This works fine 4 Go to 1 and create a new TextBox and enter a new name on a new row in the DataGridView and click on the BtnBindToTextBox to bin the new name to the new TextBox that you created As you can see is that I want to bind each entered name in the DataGridView to a TextBox that is created when I click on the BtnCreateTextBox. These steps above 1 to 3 works fine for the first time but if I create a second TextBox and enter a second name in the DataGridView and click on the BtnBindToTextBox it does List<Player> players = new List<Player> (); private int xpos = 0; private int ypos = 0; private TextBox textBox; public Form1() { InitializeComponent(); bindingSource.DataSource = players; dataGridView1.DataSource = bindingSource; } private void BtnCreateTextBox_Click(object sender
Visual Studio (1) ComponentResourceManager (1) ContentAlignment (1) GraphicsUnit (1) EventHandler (1) FontStyle (1) CheckBox (1) TextBox (1) Is this a Windows Forms application? If so, there ishould be a region titled ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InvoiceForm)); this.textBox17 = new System.Windows.Forms.TextBox(); this.textBox15 = new System.Windows.Forms.TextBox(); this.textBox7 = new System.Windows.Forms.TextBox(); this.textBox6 = new System.Windows.Forms.TextBox(); this.textBox5 = new System.Windows.Forms.TextBox(); this.textBox4 = new System.Windows.Forms TextBox(); this.textBox3 = new System.Windows.Forms.TextBox(); this.textBox2 = new System.Windows.Forms.TextBox(); this.textBox1 = new System.Windows.Forms.TextBox(); this