Click here to Skip to main content
15,914,488 members
Home / Discussions / C#
   

C#

 
GeneralRe: Handling System Events Pin
heavenamour17-May-05 18:31
heavenamour17-May-05 18:31 
GeneralUninstalling your uninstaller!! Pin
exhaulted16-May-05 4:28
exhaulted16-May-05 4:28 
GeneralRe: Uninstalling your uninstaller!! Pin
Colin Angus Mackay16-May-05 4:33
Colin Angus Mackay16-May-05 4:33 
GeneralRe: Uninstalling your uninstaller!! Pin
exhaulted16-May-05 4:41
exhaulted16-May-05 4:41 
GeneralRe: Uninstalling your uninstaller!! Pin
Colin Angus Mackay16-May-05 4:57
Colin Angus Mackay16-May-05 4:57 
GeneralRe: Uninstalling your uninstaller!! Pin
exhaulted16-May-05 5:00
exhaulted16-May-05 5:00 
GeneralRe: Uninstalling your uninstaller!! Pin
Marc Clifton16-May-05 5:30
mvaMarc Clifton16-May-05 5:30 
GeneralRe: Uninstalling your uninstaller!! Pin
exhaulted16-May-05 20:55
exhaulted16-May-05 20:55 
GeneralRe: Uninstalling your uninstaller!! Pin
Marc Clifton17-May-05 0:01
mvaMarc Clifton17-May-05 0:01 
GeneralRe: Uninstalling your uninstaller!! Pin
exhaulted17-May-05 0:24
exhaulted17-May-05 0:24 
GeneralRe: Uninstalling your uninstaller!! Pin
Dennis C. Dietrich16-May-05 9:45
Dennis C. Dietrich16-May-05 9:45 
GeneralRe: Uninstalling your uninstaller!! Pin
exhaulted16-May-05 20:57
exhaulted16-May-05 20:57 
GeneralPlease help Pin
Blue_Skye16-May-05 3:46
Blue_Skye16-May-05 3:46 
GeneralRe: Please help Pin
Gavin Jeffrey16-May-05 4:20
Gavin Jeffrey16-May-05 4:20 
GeneralRe: Please help Pin
Blue_Skye16-May-05 6:50
Blue_Skye16-May-05 6:50 
GeneralRe: Please help Pin
exhaulted16-May-05 4:23
exhaulted16-May-05 4:23 
GeneralRe: Please help Pin
Blue_Skye16-May-05 6:51
Blue_Skye16-May-05 6:51 
GeneralRe: Please help Pin
exhaulted16-May-05 20:56
exhaulted16-May-05 20:56 
QuestionHow to apply a different color then the system color to the main form menu and to the toolbars Pin
udir16-May-05 3:30
udir16-May-05 3:30 
AnswerRe: How to apply a different color then the system color to the main form menu and to the toolbars Pin
Anonymous16-May-05 6:50
Anonymous16-May-05 6:50 
GeneralRe: How to apply a different color then the system color to the main form menu and to the toolbars Pin
udir17-May-05 19:35
udir17-May-05 19:35 
GeneralMDI - Make only one child(Instance) active Pin
Subrahmanyam K16-May-05 2:24
Subrahmanyam K16-May-05 2:24 
GeneralRe: MDI - Make only one child(Instance) active Pin
Marc Clifton16-May-05 2:31
mvaMarc Clifton16-May-05 2:31 
GeneralRe: MDI - Make only one child(Instance) active Pin
Subrahmanyam K16-May-05 6:12
Subrahmanyam K16-May-05 6:12 
GeneralRe: MDI - Make only one child(Instance) active Pin
Iftahh16-May-05 4:13
Iftahh16-May-05 4:13 
well it makes a new instance because you type "Child frmChild = new Child();"
instead you want the singleton approach:

just add static instance attribute and static getInstance method -

<br />
class Child : Form {<br />
<br />
  static Child instance=null;<br />
<br />
  static Child getInstance() {<br />
     if (instance==null) instance=new Child();<br />
     return instance;<br />
  }<br />
 ...the rest of the child class...<br />
}<br />
<br />
private void mnuitmCreateChild_Click(object sender, System.EventArgs e)<br />
{<br />
Child frmChild= Child.getInstance(); // get the Child form<br />
frmChild.MdiParent=this; // make the MDI form as the parnet for the created child form<br />
frmChild.Show(); // show the child form<br />
}<br />


this way only one chlid form will form, and you can access it from everywhere in you program by using "Child.getInstance();"
if the constructor needs params then this complicates things but is still doable.

good luck,
Iftah.

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.