Click here to Skip to main content
15,917,702 members
Home / Discussions / C#
   

C#

 
GeneralRe: Get return value from one class to another Pin
Alexander Wiseman28-Jun-06 16:48
Alexander Wiseman28-Jun-06 16:48 
AnswerRe: Get return value from one class to another Pin
Mike Poz28-Jun-06 12:12
Mike Poz28-Jun-06 12:12 
AnswerRe: Get return value from one class to another Pin
Rojan Gh.28-Jun-06 14:45
professionalRojan Gh.28-Jun-06 14:45 
Questionload a whole database into a DataSet Pin
hamidreza_buddy28-Jun-06 10:56
hamidreza_buddy28-Jun-06 10:56 
AnswerRe: load a whole database into a DataSet Pin
stancrm28-Jun-06 20:26
stancrm28-Jun-06 20:26 
QuestionXMLSerialize and Microsoft Controls Pin
3Dizard28-Jun-06 10:14
3Dizard28-Jun-06 10:14 
AnswerRe: XMLSerialize and Microsoft Controls Pin
BoneSoft28-Jun-06 10:55
BoneSoft28-Jun-06 10:55 
QuestionHelp with UserControl State Save and Restore Pin
TheBlindWatchmaker28-Jun-06 9:04
TheBlindWatchmaker28-Jun-06 9:04 
Greetings!

I'm having a spot of trouble involving the saving and restoring of UserControl states on a form and was wondering if somebody could help me figure it out.

Here's some background:

1. I have 11 instances of a UserControl on a form.
2. The UserControl has, among others, two boolean properties "Mute" and "Solo".
3. Everytime the Solo property of a control goes "true", all the OTHER controls are disabled and only the "soloed" control is active. The Mute property of any control other than the soloed control may not be changed while the solo is active.

And here's the problem:

1. One or more UserControls may be muted at the time that a particular UserControl is soloed.
2. Upon "unsoloing" the soloed control, the previously muted controls should remain muted.

Here's my approach so far and some pseudocode:

1. I have two events - a SoloHandler and a MuteHandler.
2. I'm assuming that the "state memory" code needs to go into the solo handler.
3. Pseudocode

  <br />
if (sender.Solo)<br />
{<br />
   // save the controls that are currently muted;<br />
   // execute other code that soloes the control - (already implemented)<br />
<br />
}<br />
else <br />
{<br />
   // restore previous state of controls, and mute controls that were muted prior to soloing<br />
}<br />


AND FINALLY... Here's my question to you!

How do you suggest I go about saving the state?

Should I use an array and store references to the Controls in the collection using the GetChildIndex property?

Is there another way that is more elegant and is easier to code?

Thanks!
AnswerRe: Help with UserControl State Save and Restore [modified] Pin
Martin#28-Jun-06 9:59
Martin#28-Jun-06 9:59 
QuestionDatagridview.selectedValue help? Pin
PyroManiak28-Jun-06 8:38
PyroManiak28-Jun-06 8:38 
AnswerRe: Datagridview.selectedValue help? Pin
Mairaaj Khan28-Jun-06 20:11
professionalMairaaj Khan28-Jun-06 20:11 
GeneralRe: Datagridview.selectedValue help? Pin
PyroManiak29-Jun-06 10:51
PyroManiak29-Jun-06 10:51 
QuestionRegular expression Pin
NaNg1524128-Jun-06 8:36
NaNg1524128-Jun-06 8:36 
AnswerRe: Regular expression [modified] Pin
User 665828-Jun-06 8:44
User 665828-Jun-06 8:44 
GeneralRe: Regular expression Pin
Bitwise Gamgee28-Jun-06 11:41
Bitwise Gamgee28-Jun-06 11:41 
QuestionReference status bar in Windows Application Pin
Saamir28-Jun-06 8:16
Saamir28-Jun-06 8:16 
AnswerRe: Reference status bar in Windows Application Pin
Dave Kreskowiak28-Jun-06 9:25
mveDave Kreskowiak28-Jun-06 9:25 
Questionequivalent of control.CreateGraphics() for CF Pin
donkaiser28-Jun-06 8:10
donkaiser28-Jun-06 8:10 
AnswerRe: equivalent of control.CreateGraphics() for CF Pin
donkaiser28-Jun-06 8:14
donkaiser28-Jun-06 8:14 
AnswerRe: equivalent of control.CreateGraphics() for CF Pin
Guffa28-Jun-06 10:29
Guffa28-Jun-06 10:29 
GeneralRe: equivalent of control.CreateGraphics() for CF Pin
os0028-Jun-06 21:49
os0028-Jun-06 21:49 
GeneralRe: equivalent of control.CreateGraphics() for CF Pin
donkaiser29-Jun-06 5:18
donkaiser29-Jun-06 5:18 
AnswerRe: equivalent of control.CreateGraphics() for CF Pin
Guffa29-Jun-06 13:12
Guffa29-Jun-06 13:12 
AnswerRe: equivalent of control.CreateGraphics() for CF Pin
donkaiser29-Jun-06 6:51
donkaiser29-Jun-06 6:51 
QuestionRS-422 communication Pin
engsrini28-Jun-06 7:53
engsrini28-Jun-06 7:53 

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.