Click here to Skip to main content
15,921,884 members
Home / Discussions / C#
   

C#

 
AnswerRe: Getting command line params in a windows forms app Pin
Harvey Saayman14-Jul-08 5:04
Harvey Saayman14-Jul-08 5:04 
AnswerRe: Getting command line params in a windows forms app Pin
leppie14-Jul-08 4:03
leppie14-Jul-08 4:03 
AnswerRe: Getting command line params in a windows forms app Pin
Giorgi Dalakishvili14-Jul-08 4:08
mentorGiorgi Dalakishvili14-Jul-08 4:08 
GeneralRe: Getting command line params in a windows forms app Pin
leppie14-Jul-08 4:35
leppie14-Jul-08 4:35 
GeneralRe: Getting command line params in a windows forms app Pin
Giorgi Dalakishvili14-Jul-08 5:10
mentorGiorgi Dalakishvili14-Jul-08 5:10 
GeneralRe: Getting command line params in a windows forms app Pin
leppie14-Jul-08 5:37
leppie14-Jul-08 5:37 
GeneralRe: Getting command line params in a windows forms app Pin
Frank Horn14-Jul-08 8:23
Frank Horn14-Jul-08 8:23 
GeneralRe: Getting command line params in a windows forms app Pin
leppie14-Jul-08 8:30
leppie14-Jul-08 8:30 
Frank Horn wrote:
OK, you can add the params parameter to the main method. But to pass them on to the main form you better give the main form a string[] property. Or if you want to use the main form's constructor, be sure not to use the given parameterless constructor, but a second one (which has to call InitializeComponents as well), or the bloody designer will give you hell.


Why? There is a perfectly good method for that already. I will mention it again: Environment.GetCommandLineArgs(), it return exactly the same args that was passed to Main (in fact Main does not even need the string[] args parameter).

Frank Horn wrote:
By the way, this is just one of those things usually omitted by beginners' books and unmentioned in MSDN, so I think it's a fair question.


It is well documented in MSDN. Getting to read MSDN inside out takes a long time! You just need to know what you are looking for Smile | :)

xacc.ide - now with TabsToSpaces support
IronScheme - 1.0 alpha 4a out now (29 May 2008)

GeneralRe: Getting command line params in a windows forms app Pin
Frank Horn14-Jul-08 9:13
Frank Horn14-Jul-08 9:13 
QuestionZoom the pannal or windows form in VS .Net 2005 Pin
ag4667714-Jul-08 3:32
ag4667714-Jul-08 3:32 
QuestionProperties Question Pin
Harvey Saayman14-Jul-08 3:24
Harvey Saayman14-Jul-08 3:24 
AnswerRe: Properties Question Pin
leppie14-Jul-08 4:07
leppie14-Jul-08 4:07 
GeneralRe: Properties Question Pin
Harvey Saayman14-Jul-08 4:18
Harvey Saayman14-Jul-08 4:18 
GeneralRe: Properties Question Pin
leppie14-Jul-08 4:38
leppie14-Jul-08 4:38 
GeneralRe: Properties Question Pin
Alan Balkany14-Jul-08 4:38
Alan Balkany14-Jul-08 4:38 
GeneralRe: Properties Question Pin
DaveyM6914-Jul-08 4:41
professionalDaveyM6914-Jul-08 4:41 
GeneralRe: Properties Question Pin
Harvey Saayman14-Jul-08 4:50
Harvey Saayman14-Jul-08 4:50 
GeneralRe: Properties Question Pin
DaveyM6914-Jul-08 5:10
professionalDaveyM6914-Jul-08 5:10 
GeneralRe: Properties Question Pin
Harvey Saayman14-Jul-08 5:18
Harvey Saayman14-Jul-08 5:18 
GeneralRe: Properties Question Pin
DaveyM6914-Jul-08 5:26
professionalDaveyM6914-Jul-08 5:26 
QuestionCustomizing Setup Wizard Pin
Member 384581514-Jul-08 3:04
Member 384581514-Jul-08 3:04 
QuestionPick out a part of a textfile Pin
Ixzat14-Jul-08 2:35
Ixzat14-Jul-08 2:35 
AnswerRe: Pick out a part of a textfile Pin
CPallini14-Jul-08 2:54
mveCPallini14-Jul-08 2:54 
QuestionSplash Form Pin
jonhbt14-Jul-08 2:17
jonhbt14-Jul-08 2:17 
AnswerRe: Splash Form Pin
Pete O'Hanlon14-Jul-08 2:24
mvePete O'Hanlon14-Jul-08 2:24 

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.