|
See here[^].
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
Thank you for your comment...
|
|
|
|
|
Stop shouting!
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
You know, that's lovely. Your question lets you groove. That's absolutely wonderful.
|
|
|
|
|
when using the this.DialogResult = DialogResult.OK
do I still I have to do this.close()
or the DialogResult.Ok will always close?
|
|
|
|
|
jrahma wrote: or the DialogResult.Ok will always close?
This doesn't close the form, it is a possible value that a dialog window can have as a result. As long as you call ShowDialog() to open the form, you don't need to close the the form, if you are using one of the built in Winforms dialogs, you are calling the ShowDialog() method
|
|
|
|
|
Generally you only check the result after the dialog is closed by the user.
|
|
|
|
|
jrahma wrote: the DialogResult.Ok will always close?
No there is no need to close() method. I let you two Condition where how it works.
Condition: 1)
Lets two Form Name Form1 and Form2
take a button on each form1 and form2.
in Form2 on button click event write
this.DialogResult == DialogResult.OK;
and now come to form1 and write given code on button click event.
Form2 obj = new Form2();
obj.ShowDialog();
and Execute your application.
and now click on button of Form1 it shows Form2 and when click on button of form2 it close itself.
Condition: 2)
take a two button button1 and button2 on single form name Form1
and write given code on button1 click event
this.DialogResult = DialogResult.OK;
and then write below code on button2 click event
Form1 obj = new Form1();
obj.ShowDialog();
and execute your application
and when you create on button2 it open New form of itself and then when you click on button1 it close itself.
Finally you noticed in both condition there is no need to use close.
modified on Sunday, November 28, 2010 9:02 PM
|
|
|
|
|
No.
|
|
|
|
|
Sorry, the above is ambiguous (the OP is confusing to say the least); see my latest reply down below.
|
|
|
|
|
Just a minor glitch, but you need == in your comparison.
The DialogResult is only returned when the Dialog has been closed, since before it closes, no one knows what the result will be.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Walt Fair, Jr. wrote: before it closes, no one knows what the result will be.
IMO that is correct but not as simple as your statement suggests: the dialog's code could set its DialogResult property explicitly before it closes, even outside a button click handler; however being a Control, it cannot be accessed by any thread other than the one that created the dialog and is currently showing it, and that thread is just waiting for it to close, so there is no way to read DialogResult unless the dialog gets closed first.
[EDIT] I'm afraid the above no longer is relevant; the dialog closes as soon as its DialogResult gets set, see my latest reply below. [/EDIT]
|
|
|
|
|
You don't have to call Close (because the dialog is already closed), but you DO have to call Dispose if you shown the dialog with a call to its ShowDialog method. If you don't, you'll end up with a handle leak in your application and piss people off.
|
|
|
|
|
I'm afraid all of us misunderstood the question by missing the this in this.DialogResult=...
See my latest reply.
|
|
|
|
|
Sorry, I misread your question. My current answer is it closes by itself.
If the question is: When a dialog, while being shown, gets its DialogResult set, do I still need to close it explicitly?
Then I'd say NO.
Both MSDN and my little experiment indicate it closes automatically as soon as some value gets assigned.
There seems to be one exception: the value DialogResult.None does not close the dialog. This is not mentioned on the MSDN page on Form.DialogResult property, however it is somewhat mentioned on the page about DialogResult enumeration...
<
|
|
|
|
|
my project is massenger but how to create DB in server and access them u can tell me please
|
|
|
|
|
|
Didn't the teacher provide a starting-point? Which brand of database would you like to use?
I are Troll
|
|
|
|
|
First you must roll a six and call upon the Spirits of Query Languages to grant their blessing to call tables and relationships into being.
|
|
|
|
|
Your question is little bit confusing for me because you have no mention about which Database you want to create. Please be clear while you are posting your question.
|
|
|
|
|
I will develope eboard messenge use to learing and chatting as hotmail messenger but how to create email DB in server
|
|
|
|
|
hi
I have a code in C# and want to use the program in network. the network is WorkGroup and it uses the computers Windows username and password to connect each other. my SQLserver installed in windows Autentication.
my connectionString is like this:
<
<configuration>
<connectionstrings>
<add name="Budget.Properties.Settings.budgetConnectionString2"
="" connectionstring="Data Source=armansql-pc;Initial Catalog=budget;Integrated Security=True" providername="System.Data.SqlClient">
>
and now i can not find the problom. may i ask a help for a little guide?
|
|
|
|
|
Check your instance of SQL Server to see if the Browser Service is active. If it's not, it won't advertise its service on the network. Also - and this is getting vague for me, as I'm not an expert on SQL Server - I think there are limitations on how you address SQL Server. In a Workgroup you're probably using NetBIOS over TCP, which uses the common Windows resource name for a computer. I think that I recall reading somewhere that SQL Server requires a fully qualified domain name in the connection string. Of course, I could be full of sh*t, as I'm tired and fairly drunk, and I'm grasping at vague memories of things I found when I last tried to fix a SQL Server problem; my advice is worth everything it costs, and no more. But you might try looking into those two possible problem sources, nonetheless. [insert crosseyed smiley here]
Will Rogers never met me.
|
|
|
|
|
This site[^] usually helps me out.
FWIW: I've never needed a providerName
|
|
|
|
|
Dear Friends.
My problem is still remaining and i can not find any way for that.
is there any one have had similar problem Or have a sample of that?
its a simple WorkGroup Network and the computers can see each other. but why i cannot make the Connection String?
thanks for all
sincerely
|
|
|
|