Click here to Skip to main content
15,896,063 members
Home / Discussions / C#
   

C#

 
AnswerRe: hiding process arguments Pin
Shameel1-Aug-11 23:24
professionalShameel1-Aug-11 23:24 
GeneralRe: hiding process arguments Pin
navish012-Aug-11 1:58
navish012-Aug-11 1:58 
GeneralRe: hiding process arguments Pin
Dave Kreskowiak2-Aug-11 4:19
mveDave Kreskowiak2-Aug-11 4:19 
GeneralRe: hiding process arguments Pin
Shameel2-Aug-11 5:20
professionalShameel2-Aug-11 5:20 
QuestionOpening multiple instances of the same form and Identification. Pin
MAW301-Aug-11 15:58
MAW301-Aug-11 15:58 
AnswerRe: Opening multiple instances of the same form and Identification. Pin
Dr.Walt Fair, PE1-Aug-11 18:30
professionalDr.Walt Fair, PE1-Aug-11 18:30 
AnswerRe: Opening multiple instances of the same form and Identification. [modified] Pin
Shameel1-Aug-11 22:08
professionalShameel1-Aug-11 22:08 
AnswerRe: Opening multiple instances of the same form and Identification. Pin
BillWoodruff2-Aug-11 23:05
professionalBillWoodruff2-Aug-11 23:05 
You have two good answers, already, but I'll go ahead and ask whether the 1-20 Form instances are:

1. created when you launch the application: i.e., in the Main Form's 'Load or 'Shown Events, or as a result of parsing command line parameters ?

2. if created at run-time after the Main Form is shown, is their creation executed once and only once ... or, are they liable to be 'disposed,' and then a new set is created ?

If created at application launch, there are several strategies you could pursue, including:

1. making all the created Forms have the Main Form as their owner: then you can use the 'OwnedForms Form Collection of the Main Form to access them sequentially ... as long as the Main Form doesn't own other Forms of a different Type.

2.using the Application.OpenForms Form Collection, after the duplicate Forms have been shown, and iterating through it, testing for if (currentForm is FormForCopying) to discriminate copied Forms from other Forms.

A simpler strategy, independent of whether you create the Forms at launch, or at run-time:

1. Take your existing Form definition used for copies, make it sub-class Form, then add a public property to it of type int with getter and setter: as you create the copies assign the value you want to the public property.

I'd probably go with the strategy suggested in either Walt or Shameel's answers ... unless ... there were other compelling reasons to add additional properties, methods, special events, etc. to the copied Forms.

If one of your 'issues' is you want the end-user to be able to re-position the copied Forms on-demand at run-time, perhaps after moving them about, or whatever, you might consider caching their original positions the first time you display them, so that you can 'pop' them back into their original position without calculation ... assuming none have been deleted or added.

You could apply the same strategy for preserving the original positions of the copied Forms that you choose to preserve the numerical index of the Forms.

best, Bill
"In the River of Delights, Panic has not failed me." Jorge Luis Borges

Questionhow to get virtual memory using wmi Pin
anaidy0u1-Aug-11 15:57
anaidy0u1-Aug-11 15:57 
QuestionHow do you dynamically assign a datagrid's headers in c#? Pin
Xarzu1-Aug-11 15:05
Xarzu1-Aug-11 15:05 
QuestionHow to work with generic date format Pin
Gali19781-Aug-11 9:58
Gali19781-Aug-11 9:58 
AnswerRe: How to work with generic date format Pin
#realJSOP1-Aug-11 12:01
professional#realJSOP1-Aug-11 12:01 
AnswerRe: How to work with generic date format Pin
Luc Pattyn1-Aug-11 12:47
sitebuilderLuc Pattyn1-Aug-11 12:47 
GeneralRe: How to work with generic date format Pin
Dalek Dave1-Aug-11 12:49
professionalDalek Dave1-Aug-11 12:49 
GeneralRe: How to work with generic date format Pin
Luc Pattyn1-Aug-11 12:51
sitebuilderLuc Pattyn1-Aug-11 12:51 
GeneralRe: How to work with generic date format Pin
PIEBALDconsult1-Aug-11 14:42
mvePIEBALDconsult1-Aug-11 14:42 
AnswerRe: How to work with generic date format Pin
Luc Pattyn1-Aug-11 15:04
sitebuilderLuc Pattyn1-Aug-11 15:04 
GeneralRe: How to work with generic date format Pin
PIEBALDconsult1-Aug-11 19:07
mvePIEBALDconsult1-Aug-11 19:07 
AnswerRe: How to work with generic date format [modified] Pin
Luc Pattyn1-Aug-11 15:21
sitebuilderLuc Pattyn1-Aug-11 15:21 
GeneralRe: How to work with generic date format Pin
Peter_in_27801-Aug-11 16:30
professionalPeter_in_27801-Aug-11 16:30 
GeneralRe: How to work with generic date format Pin
Luc Pattyn1-Aug-11 16:55
sitebuilderLuc Pattyn1-Aug-11 16:55 
GeneralRe: How to work with generic date format Pin
PIEBALDconsult1-Aug-11 19:08
mvePIEBALDconsult1-Aug-11 19:08 
GeneralRe: How to work with generic date format Pin
Luc Pattyn2-Aug-11 1:34
sitebuilderLuc Pattyn2-Aug-11 1:34 
GeneralRe: How to work with generic date format Pin
PIEBALDconsult2-Aug-11 3:12
mvePIEBALDconsult2-Aug-11 3:12 
AnswerRe: How to work with generic date format Pin
Luc Pattyn2-Aug-11 16:58
sitebuilderLuc Pattyn2-Aug-11 16:58 

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.