|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
renaming active control from handlerThe code below works fine....however i am trying to find a way of renaming the active button control with the text entered in the 'newtxtbox' ,instead of opening a message box! -see MsgBox("test message") when enter is clicked). any ideas? ----------------------------------------------------------------------------------- Private Sub RenameToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RenameToolStripMenuItem.Click Dim NewTxtBox As New TextBox NewTxtBox.Location = ContextMenuStrip1.SourceControl.Location Me.Controls.Add(NewTxtBox) NewTxtBox.BringToFront() NewTxtBox.Text = "Type and Hit Enter" AddHandler NewTxtBox.KeyPress, AddressOf TextBox1_KeyPress End Sub --------------------------------------------------------------------------------------------------------------------------------- Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) If e.KeyChar = Chr(Keys.Enter) Then MsgBox("test message") End If End Sub Read from your other post.
-- -- Thiele Enterprises - The Power Is In Your Hands Now! -- "Marc" <marc_cro***@hotmail.com> wrote in message The code below works fine....however i am trying to find a way ofnews:1165080113.927815.245240@l12g2000cwl.googlegroups.com... Hi all, renaming the active button control with the text entered in the 'newtxtbox' ,instead of opening a message box! -see MsgBox("test message") when enter is clicked). any ideas? ----------------------------------------------------------------------------------- Private Sub RenameToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RenameToolStripMenuItem.Click Dim NewTxtBox As New TextBox NewTxtBox.Location = ContextMenuStrip1.SourceControl.Location Me.Controls.Add(NewTxtBox) NewTxtBox.BringToFront() NewTxtBox.Text = "Type and Hit Enter" AddHandler NewTxtBox.KeyPress, AddressOf TextBox1_KeyPress End Sub --------------------------------------------------------------------------------------------------------------------------------- Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) If e.KeyChar = Chr(Keys.Enter) Then MsgBox("test message") End If End Sub
enter key press
best way to learn Windows Forms Upgrading Access 97 application to dotNet For loop variable date Merging two tables in Dataset? I only want to get the matching info based on the two key fields How to set an objects property using Reflection Working with a database PIAs for Excel 9.0 Make Code Fail How do you start an assembly dynamically with constructors Enter Key vs. Tab Key |
|||||||||||||||||||||||