Click here to Skip to main content
15,908,445 members
Home / Discussions / C#
   

C#

 
GeneralRe: DesignerSerializationAttribute Pin
Kastro2-Jul-03 8:58
Kastro2-Jul-03 8:58 
GeneralSome C++ conversions over C#? Need help! Pin
Member 160351-Jul-03 7:54
Member 160351-Jul-03 7:54 
GeneralRe: Some C++ conversions over C#? Need help! Pin
jspano2-Jul-03 14:54
jspano2-Jul-03 14:54 
GeneralRe: Some C++ conversions over C#? Need help! Pin
Nick Seng2-Jul-03 15:45
Nick Seng2-Jul-03 15:45 
GeneralEffective Localization & Management of String Resources Pin
Sin Jeong-hun1-Jul-03 7:46
Sin Jeong-hun1-Jul-03 7:46 
Generalmanaged compiler question Pin
LongRange.Shooter1-Jul-03 6:02
LongRange.Shooter1-Jul-03 6:02 
GeneralRe: managed compiler question Pin
leppie1-Jul-03 11:58
leppie1-Jul-03 11:58 
GeneralRe: managed compiler question Pin
LongRange.Shooter2-Jul-03 3:57
LongRange.Shooter2-Jul-03 3:57 
GeneralRe: managed compiler question Pin
leppie2-Jul-03 7:40
leppie2-Jul-03 7:40 
GeneralTemplatePrinte source code Pin
nahumtakum1-Jul-03 4:07
nahumtakum1-Jul-03 4:07 
GeneralNeed help with service depencies Pin
Stas1-Jul-03 3:50
Stas1-Jul-03 3:50 
GeneralRe: Need help with service depencies Pin
Valeria Bogdevich1-Jul-03 4:57
Valeria Bogdevich1-Jul-03 4:57 
GeneralLaunching script on build Pin
AJ1231-Jul-03 3:35
AJ1231-Jul-03 3:35 
GeneralRe: Launching script on build Pin
Nathan Blomquist1-Jul-03 5:56
Nathan Blomquist1-Jul-03 5:56 
GeneralRe: Launching script on build Pin
AJ1231-Jul-03 7:07
AJ1231-Jul-03 7:07 
GeneralRe: Launching script on build Pin
Nathan Blomquist2-Jul-03 1:51
Nathan Blomquist2-Jul-03 1:51 
GeneralStatic Question Pin
CyberKewl1-Jul-03 3:02
CyberKewl1-Jul-03 3:02 
GeneralRe: Static Question Pin
Roland Bär1-Jul-03 4:58
Roland Bär1-Jul-03 4:58 
Generalhelp!! Pin
jphuphilly1-Jul-03 2:41
jphuphilly1-Jul-03 2:41 
GeneralRe: help!! Pin
leppie1-Jul-03 13:08
leppie1-Jul-03 13:08 
GeneralGetObjectsForNativeVariants Pin
vikramlinux1-Jul-03 1:23
vikramlinux1-Jul-03 1:23 
QuestionHow do I create a Dialog ? Pin
JeffSayHi1-Jul-03 1:20
JeffSayHi1-Jul-03 1:20 
AnswerRe: How do I create a Dialog ? Pin
Manster1-Jul-03 4:29
Manster1-Jul-03 4:29 
GeneralRe: How do I create a Dialog ? Pin
JeffSayHi1-Jul-03 14:50
JeffSayHi1-Jul-03 14:50 
AnswerRe: How do I create a Dialog ? Pin
LongRange.Shooter1-Jul-03 11:03
LongRange.Shooter1-Jul-03 11:03 
I have constructed many dialogs in my apps where I would do the following:

Build the dialog as a form within the project
Fill out the dialog box with everything I wanted to collect form the user.
Expose those items with public accessors
Add an Okay button which sets DialogResult = DialogResult.OK; etc.

(example: AskForFiles has englishDict frenchDict and germanDict exposed as public accessors. The user can click buttons to browse for the dictionary files in the dialog)

In my main program I then add this code:

C#
AskForFiles newDialog = new AskForFiles();
if (some file names already defined)
{
   newDialog.englishDict = value;
   newDialog.frenchDict  = value;
   newDialog.germanDict  = value;
}
newDialog.ShowDialog(this);
if (newDialog.DialogResults == DialogResults.OK)
   newFileName1 = newDialog.englishDict;
        ...


This way you can issue a dialog, get the results from that dialog, with OK indicating they set all the values and Cancel indicating they changed their minds. You need to make sure you never issue a return without a this.Close() and setting this.DialogResult.

I also make the form properties for Abort and Accept set to the corresponding buttons on the form so any key input creates the desired results as well. For example: the user enters all dictionary names and hits enter is the same as clicking the Okay button. the user hits Esc is the same as clicking the Cancel button. etc...


_____________________________________________
The world is a dangerous place.
Not because of those that do evil,
    but because of those who look on and do nothing.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.