Click here to Skip to main content
15,906,558 members
Home / Discussions / C#
   

C#

 
GeneralRe: String Formatting / Interpolation --- Opinions Pin
jschell22-Jan-16 13:55
jschell22-Jan-16 13:55 
AnswerRe: String Formatting / Interpolation --- Opinions Pin
jschell22-Jan-16 14:01
jschell22-Jan-16 14:01 
GeneralRe: String Formatting / Interpolation --- Opinions Pin
Sascha Lefèvre22-Jan-16 23:06
professionalSascha Lefèvre22-Jan-16 23:06 
GeneralRe: String Formatting / Interpolation --- Opinions Pin
jschell28-Jan-16 12:48
jschell28-Jan-16 12:48 
GeneralI want to understand namespace System.Security Pin
BasmaSH19-Jan-16 20:01
BasmaSH19-Jan-16 20:01 
GeneralRe: I want to understand namespace System.Security Pin
dan!sh 19-Jan-16 20:53
professional dan!sh 19-Jan-16 20:53 
GeneralRe: I want to understand namespace System.Security PinPopular
CHill6020-Jan-16 0:38
mveCHill6020-Jan-16 0:38 
QuestionRemoving EXIF Does not work when using Different Encoders to Choose Format Pin
Member 1227351319-Jan-16 2:30
Member 1227351319-Jan-16 2:30 
QuestionProblem solved: problem de-serializing using GZip: file left "open" Pin
BillWoodruff17-Jan-16 1:45
professionalBillWoodruff17-Jan-16 1:45 
AnswerRe: problem de-serializing using GZip: file left "open" Pin
OriginalGriff17-Jan-16 2:32
mveOriginalGriff17-Jan-16 2:32 
SuggestionRe: problem de-serializing using GZip: file left "open" Pin
Sascha Lefèvre17-Jan-16 3:24
professionalSascha Lefèvre17-Jan-16 3:24 
GeneralRe: problem de-serializing using GZip: file left "open" Pin
BillWoodruff17-Jan-16 4:11
professionalBillWoodruff17-Jan-16 4:11 
GeneralRe: problem de-serializing using GZip: file left "open" Pin
Sascha Lefèvre17-Jan-16 5:41
professionalSascha Lefèvre17-Jan-16 5:41 
GeneralRe: problem de-serializing using GZip: file left "open" Pin
BillWoodruff17-Jan-16 4:06
professionalBillWoodruff17-Jan-16 4:06 
GeneralRe: problem de-serializing using GZip: file left "open" Pin
OriginalGriff17-Jan-16 4:21
mveOriginalGriff17-Jan-16 4:21 
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 

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.