|
what do you mean? you're not dedicated??
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read formatted code with indentation, so please use PRE tags for code snippets.
I'm not participating in frackin' Q&A, so if you want my opinion, ask away in a real forum (or on my profile page).
|
|
|
|
|
i want msgbox if i press enter key on textbox control
|
|
|
|
|
You are unbelievable here;
Private Sub TextBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
If e.KeyCode = Keys.Enter Then
MsgBox(TextBox1.Text)
End If
End Sub
|
|
|
|
|
thats not working, that is why i m asking again n again
|
|
|
|
|
Do not keep re-asking the same thing, or people will get pi$$ed off.
Stick within the original thread and edit/respond as appropriate. Maybe you are not being clear with your question and thats why you are not getting the response you are expecting.
I understand that english is maybe not your first language, and putting technical queries from your native tongue to english is maybe not easy, but patience and maybe a little help from Google Translate is all that is required!
Cheers,
|
|
|
|
|
how to call msgbox in vb.net on enter key press event
|
|
|
|
|
What are you up to ??? This is the third time you've asked this, and it has been answered in two laguages. Stop reposting.
|
|
|
|
|
Are we taking bets for a quadruple posting of the same question?
|
|
|
|
|
I think it's up to six times now, although I think he's got the message now
|
|
|
|
|
Please try not to TRIPLE post your questions.............
|
|
|
|
|
how to call msgbox on key(enter) even on textbox control in VB.NET
|
|
|
|
|
Please, try not to double post.
My advice is free, and you may get what you paid for.
|
|
|
|
|
how to call msg box on Enter(key) press event in vb.net
|
|
|
|
|
use the below code
private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
{
if (e.KeyChar == (char)(0x0D))
MessageBox.Show("Enter Pressed");
}
Thanks
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
I assume you want it VB.Net not C#. Try this
Private Sub txtTest_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles txtTest.KeyDown
If e.KeyCode = Keys.Enter Then
MsgBox("You pressed the Enter Key")
End If
End Sub
Happy Coding
|
|
|
|
|
Hello!
Could u help me pls
How to add a new context menu into the CD drive's context menu ? [ie.close tray,open tray(eject)]
i'll thz ........
|
|
|
|
|
I gave you a link to article on Context Menu's yesterday when you asked this question.
Now that you know what to look for, have you tried doing some of your own research using google / codeproject etc?
Start writing your own code now, and come back when you have a specific problem.
|
|
|
|
|
how to bound text box control for numeric keys in vb.net
|
|
|
|
|
use char.IsDigit method
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
I have a form that is showing a MessageBox using MessageBox.Show, and trying to receive events from the Help button on the MessageBox so I can execute my own code. The Microsoft documentation shows how to do this; however, using what is suggested does not work. Here's a shortened version of my code:
Private Function MethodName() As Boolean
AddHandler Me.HelpRequested, AddressOf Me.MsgBoxHelpRequested
Select Case MessageBox.Show("Text", "Title", MessageButtons.YesNoCancel, _
MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, 0, True)
Case MsgBoxResult.Yes
' Do stuff
Case MsgBoxResult.No
' Do stuff
Case MsgBoxResult.Cancel
RemoveHandler Me.HelpRequested, AddressOf Me.MsgBoxHelpRequested
Return False
End Select
RemoveHandler Me.HelpRequested, AddressOf Me.MsgBoxHelpRequested
End Function
'
'
Private Sub MsgBoxHelpRequested(ByVal sender As Object, _
ByVal hlpevent As System.Windows.Forms.HelpEventArgs)
' Breakpoint that never gets hit
' More code
End Sub
I posted this question yesterday on stackoverflow[^], where we get into quite a spirited discussion, with a bunch of suggestions that ultimately never seemed to pan out, if you want to see what I've already tried.
Currently I'm working on seeing if there's any way to determine if the event was even raised in the first place - either by trying to manually raise the event and see if my code gets called, or seeing if there's any way to break on an event.
Does anybody have any suggestions?
Oh, and by the way, Chris Maunder: CodeProject is much better designed than StackOverflow. Reading stackoverflow is a pain on the eyes, trying to comment is a pain in the neck - coming back home here is such a relief. While the people over there are just as nice as here, I wish I had thought to check here yesterday.
|
|
|
|
|
Yes i have a suggestion;
I placed a button on the form, and coded the following;
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim response As MsgBoxResult = MsgBox("the prompt", MsgBoxStyle.MsgBoxHelp + MsgBoxStyle.Information + MsgBoxStyle.YesNo, "The Title")
MsgBox(response)
End Sub
Private Sub FormMain_HelpRequested(ByVal sender As Object, ByVal hlpevent As System.Windows.Forms.HelpEventArgs) Handles Me.HelpRequested
MsgBox("help Requested")
End Sub
This displays a Yes No Help msgbox, when the help is pressed, another msgbox appears with the help requested.
Based on this, what you could do is set a variable before entering the msgbox with some form of identifier, then in the HelpRequested call, check the value of that variable and perform the appropriate help action.
|
|
|
|
|
Okay, I'm not sure why you're showing a second MsgBox to display the MsgBoxResult of the first one in the first function, but the second function doesn't help me because it's yet another variation of what I've been trying to do that I have already determined does not work for me.
|
|
|
|
|
i was only using msgbox to illustrate a point thats all.
What are you trying to do then, what i have shown in the example code is the help button being handled, which is what i thought you couldn't achieve?
Private helpTopic as integer =0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
helpTopic = 1
Dim response As MsgBoxResult = MsgBox("the prompt", MsgBoxStyle.MsgBoxHelp + MsgBoxStyle.Information + MsgBoxStyle.YesNo, "The Title")
If response = vbYes Then
Else
End If
End Sub
Private Sub FormMain_HelpRequested(ByVal sender As Object, ByVal hlpevent As System.Windows.Forms.HelpEventArgs) Handles Me.HelpRequested
Select Case helpTopic
Case 1
Case Else
End Select
End Sub
is that better without the extra msgboxes!
|
|
|
|
|
Sorry to snap at you, I got a little annoyed yesterday at people telling me what to do and posting essentially my exact code.
Your code isn't the current iteration of my exact code, but it's been tried.
Unsuccessfully.
|
|
|
|
|
So, I'm not sure what's wrong with your code. I did this:
Private Sub Button3_Click(...)
AddHandler Me.HelpRequested, AddressOf Me.MsgBoxHelpRequested
Select Case MessageBox.Show("Text","Title", MessageBoxButtons.YesNoCancel, _
MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, 0, True)
End Select
End Sub
Private Sub MsgBoxHelpRequested(...)
MessageBox.Show("got here")
End Sub
and I "got here". Am I the only one that this works for?
|
|
|
|