M
Marc
Hi,
I want my user to be able to rename a button control by selcting rename
from a menu. This then opens a text box in which to enter the new name
in. I want the button control to inherit the name when the enter key is
pressed.
Below is my code so far....all I am missing is the code to accept the
changes on hitting enter. I have tried various things but cannot get it
working. I really want to control everything from within this private
sub.
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 = ActiveControl.Location
Me.Controls.Add(NewTxtBox)
NewTxtBox.BringToFront()
NewTxtBox.Text = "Type and Hit Enter"
ActiveControl.Text = NewTxtBox.Text
End If
End Sub
Reply »
I want my user to be able to rename a button control by selcting rename
from a menu. This then opens a text box in which to enter the new name
in. I want the button control to inherit the name when the enter key is
pressed.
Below is my code so far....all I am missing is the code to accept the
changes on hitting enter. I have tried various things but cannot get it
working. I really want to control everything from within this private
sub.
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 = ActiveControl.Location
Me.Controls.Add(NewTxtBox)
NewTxtBox.BringToFront()
NewTxtBox.Text = "Type and Hit Enter"
ActiveControl.Text = NewTxtBox.Text
End If
End Sub
Reply »