Click here to Skip to main content
15,887,477 members
Home / Discussions / C#
   

C#

 
GeneralRe: problem de-serializing using GZip: file left "open" Pin
BillWoodruff17-Jan-16 6:49
professionalBillWoodruff17-Jan-16 6:49 
QuestionHow to disable show again the same form ? Pin
Member 1224802814-Jan-16 0:16
Member 1224802814-Jan-16 0:16 
AnswerRe: How to disable show again the same form ? Pin
John Torjo14-Jan-16 4:02
professionalJohn Torjo14-Jan-16 4:02 
GeneralRe: How to disable show again the same form ? Pin
Member 1224802814-Jan-16 11:18
Member 1224802814-Jan-16 11:18 
GeneralRe: How to disable show again the same form ? Pin
Mycroft Holmes14-Jan-16 11:46
professionalMycroft Holmes14-Jan-16 11:46 
GeneralRe: How to disable show again the same form ? Pin
Member 1224802814-Jan-16 11:59
Member 1224802814-Jan-16 11:59 
GeneralRe: How to disable show again the same form ? Pin
Sascha Lefèvre14-Jan-16 12:14
professionalSascha Lefèvre14-Jan-16 12:14 
AnswerRe: How to disable show again the same form ? Pin
BillWoodruff14-Jan-16 21:30
professionalBillWoodruff14-Jan-16 21:30 
Without seeing your code, I can only propose an answer that I think will work independent of your UI design; if I could see your code, I'd probably propose creating a "local" boolean variable.

1. set a global static variable 'IsVolumeControlShown
C#
public static class ApplicationGlobals
{
    public static bool IsVolumeControlShown = false;
}
2. when you get the event notification to show the VolumeControl:
C#
public EyesAtTopEvent(????, ????)
{
    if(! ApplicationGlobals.IsVolumeControlShown)
    {
        VolumeControl.Show();
        ApplicationGlobals.IsVolumeControlShown = true;
    }
}
3. When you get the Event to hide the VolumeControl:
C#
public EyesNotAtTopEvent(????, ????)
{
    if(ApplicationGlobals.IsVolumeControlShown)
    {
        VolumeControl.Hide();
        ApplicationGlobals.IsVolumeControlShown = false;
    }
}
Note: this is not code I would actually use, but an example I hope will indicate to you a "path to follow:"

0. create the VolumeControl whatever (panel ? form ?) once and keep a reference to it where you can access it.

1. use a variable to control the visibility of the VolumeControl

2. use that variable in the right place to show/hide the VolumeControl as needed.

Note: "ideally" you would be so "in control" of the code that you would be certain when you were showing or hiding the VolumeControl, in which case you would not have to check the current visible state of the VolumeControl every time you needed to show or hide it. However, imho, the kind of "defensive programming" shown here ... the visible state check ... is often useful in UI work where events may happen at a high frequency.
«Tell me and I forget. Teach me and I remember. Involve me and I learn.» Benjamin Franklin


modified 15-Jan-16 7:57am.

GeneralRe: How to disable show again the same form ? Pin
Member 1224802815-Jan-16 11:03
Member 1224802815-Jan-16 11:03 
Questionsending/receiving sms with c# code using smartphone Pin
Roberto64_Ge12-Jan-16 4:24
Roberto64_Ge12-Jan-16 4:24 
AnswerRe: sending/receiving sms with c# code using smartphone Pin
Dave Kreskowiak12-Jan-16 4:38
mveDave Kreskowiak12-Jan-16 4:38 
QuestionReport builder in c# Pin
Zeyad Jalil12-Jan-16 2:47
professionalZeyad Jalil12-Jan-16 2:47 
AnswerRe: Report builder in c# Pin
Pete O'Hanlon12-Jan-16 3:14
mvePete O'Hanlon12-Jan-16 3:14 
GeneralRe: Report builder in c# Pin
Zeyad Jalil12-Jan-16 6:58
professionalZeyad Jalil12-Jan-16 6:58 
GeneralRe: Report builder in c# Pin
F-ES Sitecore12-Jan-16 23:27
professionalF-ES Sitecore12-Jan-16 23:27 
AnswerRe: Report builder in c# Pin
ZurdoDev12-Jan-16 3:55
professionalZurdoDev12-Jan-16 3:55 
GeneralRe: Report builder in c# Pin
Zeyad Jalil12-Jan-16 6:58
professionalZeyad Jalil12-Jan-16 6:58 
AnswerRe: Report builder in c# Pin
rodrigogroff12-Jan-16 4:01
rodrigogroff12-Jan-16 4:01 
GeneralRe: Report builder in c# Pin
Zeyad Jalil12-Jan-16 6:59
professionalZeyad Jalil12-Jan-16 6:59 
GeneralRe: Report builder in c# Pin
rodrigogroff12-Jan-16 7:42
rodrigogroff12-Jan-16 7:42 
AnswerRe: Report builder in c# Pin
Brisingr Aerowing12-Jan-16 4:08
professionalBrisingr Aerowing12-Jan-16 4:08 
GeneralRe: Report builder in c# Pin
Zeyad Jalil12-Jan-16 6:59
professionalZeyad Jalil12-Jan-16 6:59 
GeneralRe: Report builder in c# Pin
Brisingr Aerowing12-Jan-16 13:31
professionalBrisingr Aerowing12-Jan-16 13:31 
AnswerRe: Report builder in c# Pin
Mycroft Holmes12-Jan-16 12:07
professionalMycroft Holmes12-Jan-16 12:07 
AnswerRe: Report builder in c# Pin
Gerry Schmitz12-Jan-16 16:39
mveGerry Schmitz12-Jan-16 16:39 

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.