|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Problem saving txt box with enter keyI have a text box. I simply want to save the text from the text box (and popluate a buttons text) and remove the text box when a user hits the enter button. Can someone help? 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) Dim KeyAscii As Keys If KeyAscii = Keys.Enter Then Me.Controls.Remove(NewTxtBox) ActiveControl.Text = NewTxtBox.Text End If End Sub Marc. Examples that will help you find the answer to almost every question
you have asked in the past few days (in this newsgroup) can be found in the VS2005 documentation which can be accessed by pressing F1 whilst in the VS2005 IDE. Have you actually bothered to look there? Show quoteHide quote "Marc" <marc_cro***@hotmail.com> wrote in message news:1164493942.207224.270310@45g2000cws.googlegroups.com... > Guys, > > I have a text box. I simply want to save the text from the text box > (and popluate a buttons text) and remove the text box when a user hits > the enter button. > > Can someone help? > > > 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) > > > Dim KeyAscii As Keys > If KeyAscii = Keys.Enter Then > Me.Controls.Remove(NewTxtBox) > ActiveControl.Text = NewTxtBox.Text > End If > End Sub > Yes its not there
Stephany Young wrote: Show quoteHide quote > Marc. Examples that will help you find the answer to almost every question > you have asked in the past few days (in this newsgroup) can be found in the > VS2005 documentation which can be accessed by pressing F1 whilst in the > VS2005 IDE. > > Have you actually bothered to look there? > > > "Marc" <marc_cro***@hotmail.com> wrote in message > news:1164493942.207224.270310@45g2000cws.googlegroups.com... > > Guys, > > > > I have a text box. I simply want to save the text from the text box > > (and popluate a buttons text) and remove the text box when a user hits > > the enter button. > > > > Can someone help? > > > > > > 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) > > > > > > Dim KeyAscii As Keys > > If KeyAscii = Keys.Enter Then > > Me.Controls.Remove(NewTxtBox) > > ActiveControl.Text = NewTxtBox.Text > > End If > > End Sub > > What do you mean by 'Yes its not there'?
Do you mean that you have looked and you can't find it, or do you mean that when you press F1, the help/documentation does not appear? If it is the latter then install your copy of VS2005 correctly. If it is the former then try a few searches on pertinent keywords. In the index, typing keys.e brings up a entry named Keys.ControlKey enumeration member which in turn provides an example of hooking up an event that will handle the pressing of a key. Show quoteHide quote "Marc" <marc_cro***@hotmail.com> wrote in message news:1164531891.059041.315510@n67g2000cwd.googlegroups.com... > Yes its not there > > Stephany Young wrote: >> Marc. Examples that will help you find the answer to almost every >> question >> you have asked in the past few days (in this newsgroup) can be found in >> the >> VS2005 documentation which can be accessed by pressing F1 whilst in the >> VS2005 IDE. >> >> Have you actually bothered to look there? >> >> >> "Marc" <marc_cro***@hotmail.com> wrote in message >> news:1164493942.207224.270310@45g2000cws.googlegroups.com... >> > Guys, >> > >> > I have a text box. I simply want to save the text from the text box >> > (and popluate a buttons text) and remove the text box when a user hits >> > the enter button. >> > >> > Can someone help? >> > >> > >> > 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) >> > >> > >> > Dim KeyAscii As Keys >> > If KeyAscii = Keys.Enter Then >> > Me.Controls.Remove(NewTxtBox) >> > ActiveControl.Text = NewTxtBox.Text >> > End If >> > End Sub >> > >
calling math functions at run time
regarding .net help Good book for an absolute beginner on VB.net or 2005 with databases newbie: foundfile attributes? (filesize, saved date, etc.) Can someone please translate this to VB.Net need help with 1 line of code now! Opening...Closing Forms WIALib error My.Computer.Network.UploadFile error round function not working |
|||||||||||||||||||||||