|
2 ways
Create a property (Choice) on the dialog and instead of closing the dialog from the parent just hide it, have the parent then extract the choice from the dialog property.
You can also use a delegate do the cross referencing but I don't use it. There are some articles here somewhere. I beleive the delegate method is the more "elegant" way to do it.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: instead of closing the dialog from the parent just hide it
Why not closing it? Whether you close it or just hide it, you can access the property on the form in both scenarios:
MyDialog dialog = new MyDialog();
dialog.ShowModal();
var someVariable = dialog.Choice;
-^-^-^-^-^-^-^-
no risk no funk
|
|
|
|
|
Badly worded, I should have said - instead of closing the dialog you should hide it and close if from the parent form after extracting the information.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Mycroft Holmes wrote: nstead of closing the dialog you should hide it and close if from the parent form after extracting the information.
NNONONONONONONnoonononononooooooo!
If you close it, the OBJECT that is the dialog STILL EXISTS as you (the mainform) still has a reference to it - so you can access any public methods or properties of the dialog object from the main form - even though the dialog box is no longer visible and has been closed.
ShowDialog() shows the form and waits until it is closed - so hiding it from the parent doesn't make sense - and hiding it from within the dialog itself is a waste of time, as you have to close it to return to the parent form - that's sort of the definition of a dialog!
IOW closed does NOT equal disposed.
Life is like a pubic hair on the toilet seat...
...sometimes, you just get pissed off.
.\\axxx
(That's an 'M')
|
|
|
|
|
hi friends i want to know how to create session in windowApplication and also how to maintain single language in session(English,Arabic(it's a multilingual Application))
help me.
Advance Thanx,
Arun.R
modified on Monday, November 17, 2008 1:16 AM
|
|
|
|
|
If you're talking about a Session, like you see in an ASP.NET application, there's no such thing. Perhaps if you described what you're really trying to accomplish with this, we can help.
|
|
|
|
|
hi friends,
Now i am creating multilingual .net window apllication its in two languages English and Arabic,It's in English no problem all the controls in left side it's in Arabic all the controls i want right side eg.[English] label control leftside ,text box right side [Arabic] textbox leftside labels right side in single form.and also i want to type anything in text box all the text will comes in right to left indent.and i want to know how to use localization technique in session.and also i want to know how all messages and interactions with user should be integrated with bilingual support (error messages, information messages, etc.).please help me friends.
Arun
|
|
|
|
|
For positioning controls you can change the location property for each to swap sides of the form on which they appear. For simplicity, I'd just make two different forms, one for each language, but I'm still a dummy at this. It can probably be done just as easily at run time. To make the text run right-to-left, you can change the Right To Left property of the label and textbox, according to the label on the box here. I can't test that, since I don't know any other languages, but the containing form has properties to select the language and to enable localization. When I try Right To Left = True, all it does is align my English text with the right edge of the label. But I suspect that if I set the Form property Language to Arabic, and Localization to True, the result would be exactly what you seek. Give it a try.
I'd try it for you, but 1) it took me all day to make this dialog box look right and I don't want to mess with it, and 2) I wouldn't know by looking at it whether Arabic was RTL or LTR.
Good luck!
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Thanx a Lot Mr.Roger Wright
|
|
|
|
|
Hi,
i want to display a WinHelp (.hlp) file within windows forms. If anyone know please help me.
Advance Thanks
S.Selvaraj
|
|
|
|
|
WinHelp (.hlp) is deprecated with no future support planned in Windows, nor is there any support for it in the .NET Framework BCL. I highly suggest using .CHM instead (compiled HTML) instead. Google results for "vb.net help file[^]".
|
|
|
|
|
Thanks. but i didn't get any solution.
Please anybody help me to show a winhelp (.hlp) file within windows form in vb.net
|
|
|
|
|
|
WinHelp (.hlp) is deprecated with no future support planned in Windows
In other words, if you try to learn this deprecated technology it will be of no use to you in the future. Everything as of right now uses the .chm file format which is not deprecated.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my Blog
|
|
|
|
|
Yes, you did. Your BEST option is to convert this to a CHM file instead of using WinHelp. Windows 7 is going to be out late next year, and you guessed it, there's no support for WinHelp. So why are you insisting on using it?
|
|
|
|
|
Hi all.
I'm new in Windows Forms.
Is there is some control to enter time data.
Like a NumericUpDown, but for time in format MM:SS.mmmm.
And where I can find such control (if it exists), what assembly?
Dot want to waste time implementing the new one.
Thanks.
|
|
|
|
|
There's a DateTimePicker[^] control. Set the format property to Time.
Or you can use a use a MaskedTextBox[^] control. There is a sample time format mask provided or you can define your own.
Simon
|
|
|
|
|
Well, thanks for reply. I can use them. But custm format doesnt support displaying milliseconds.
So, I have to use what Windows Forms have...
|
|
|
|
|
If you use the masked text box you should be able to define whatever format you want.
Try setting the mask to something like "00:00:00.0000"
You'll probably have to manually validate things like the seconds don't go above 59 etc.
Is that what you are looking for?
progDes wrote: So, I have to use what Windows Forms have...
You could write a custom control if you really wanted, but from the sounds of it, I think the masked text box will probably do the job.
You could write a custom control and inherit from the masked text box and just add the extra time validation logic. That would be quite a good way of doing things.
Simon
|
|
|
|
|
|
You know the Pending Checkin window in Visual Studio? You know how it has a tree view but each node is a checkbox? Is there a built-in WinForms control that does this? I need one that I can populate with nodes and children at run time and has functionality like if a child is checked, the parent is checked. Anybody got any ideas?
My mind is like an aluminum trap. Some things get caught in the trap, and some things bend the trap and get away.
|
|
|
|
|
Nevermind. I may have figured it out.
My mind is like an aluminum trap. Some things get caught in the trap, and some things bend the trap and get away.
|
|
|
|
|
i create a project in c# windows, but i can't declare connection globalyy in my project please help me
|
|
|
|
|
You didn't say what the problem is so few ways to start with:
- public/internal static or singleton class
- resource file etc
The need to optimize rises from a bad design.
My articles[ ^]
|
|
|
|
|
connection class through public like connection class for connection, dropdown populate, combobox populate, grid view populate,etc
|
|
|
|