Click here to Skip to main content
15,907,687 members
Please Sign up or sign in to vote.
2.00/5 (3 votes)
See more:
Dear Friends:

I have one textBox when i write in textBox logOff, that time i call to DialogResult button==messageBox.show("","",MessageBoxButton.YesNo) and it appear to me dialogBox which have yes button and no button when i click yes or no button then action will perform.

My Question is that:when MessageBoxButton.YesNo Dialog appears that time i want to control these YesNo button through my textBox text.
Example: When i write in textBox.text="yes" yes button event occurred from MessageBoxButton.YesNo dialog or if i write in textBox.text="no" No button event become execute. I search Google but i did not find acceptable solution.
Wish you some Body help me.
Thank you.
Posted
Updated 25-Feb-11 18:59pm
v2

Is is so difficult to take a look at MessageBox help?!

Almost every line in this Question is incorrect.

"Call to DialogResult"
: no you don't. This is the name of enumeration type. You can call MessageBox.Show though.

"button==messageBox.show("","",MessageBoxButton.YesNo)" will not even compile. (Side note, write string.Empty, not "".) Why should anyone spend time on answering a Question it the Inquirer does not bother the spell code?! What, copy and paste is a problem, too?!

"...when MessageBoxButton.YesNo Dialog appears..." there is no such dialog.

"When i write in textBox.text="yes"...", the code will not compile, so further question does not make sense.

"button event occurred from MessageBoxButton.YesNo dialog"
; there is no just "button event"; there is no such dialog.

"I search Google but i did not find acceptable solution." Yes, of course, because the Question is absolutely unique. I never would have guessed anyone would ask something like that, was very surprised by this text.

I'll make only one note here: DialogBox.Show shows a modal dialog.

Using MessageBox is trivial all answers are in it's help. The problem is different: there is no a Question here. More than that, there is no ability not only to ask a Question but even the ability to realize the problem. So, further detail makes no sense: 1) they won't answer the Question because it has no sense; 2) further detail are not needed because everyone can use the class MessageBox correctly after first read of the help and those rare people who would not cannot understand the explanation.

In difficult situations, I usually offer general recommendations, like reading literature, doing exercises, etc. In this case I don't really know what else to say...

—SA
 
Share this answer
 
Comments
Espen Harlinn 26-Feb-11 10:33am    
Good effort, my 5
Sergey Alexandrovich Kryukov 26-Feb-11 10:47am    
Thank you.
unfortunately...
--SA
Abdullahomaid 28-Feb-11 10:54am    
thank you useless man ,less take care about your writing. what is Is is??????????????????
look to ur following Is is .

Is is so difficult to take a look at MessageBox help?!
Sergey Alexandrovich Kryukov 1-Mar-11 3:21am    
Where did you see "?????" or whatever.
You're extremely rude and illiterate. No help for you anymore.
--SA
do
if(MessageBox.show(...)==DialogResult.Yes) ...


you could use
DialogResult.No
DialogResult.Ok
and so on


or
DialogResult dr=MessageBox.show(...);

switch(dr)
{
case DialogReslut.No: break;
case DialogReslut.Yes: break;
case DialogReslut.Ok: break;
}
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900