Click here to Skip to main content
15,905,420 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# win forms .net core, user control, array on a dialog. Pin
BillWoodruff27-Oct-20 23:05
professionalBillWoodruff27-Oct-20 23:05 
GeneralMessage Closed Pin
27-Oct-20 23:44
Member 1332584627-Oct-20 23:44 
GeneralRe: C# win forms .net core, user control, array on a dialog. Pin
OriginalGriff28-Oct-20 0:03
mveOriginalGriff28-Oct-20 0:03 
GeneralRe: C# win forms .net core, user control, array on a dialog. Pin
jkirkerx28-Oct-20 4:32
professionaljkirkerx28-Oct-20 4:32 
GeneralRe: C# win forms .net core, user control, array on a dialog. Pin
OriginalGriff28-Oct-20 4:40
mveOriginalGriff28-Oct-20 4:40 
GeneralRe: C# win forms .net core, user control, array on a dialog. Pin
jkirkerx28-Oct-20 4:49
professionaljkirkerx28-Oct-20 4:49 
GeneralRe: C# win forms .net core, user control, array on a dialog. Pin
OriginalGriff28-Oct-20 5:20
mveOriginalGriff28-Oct-20 5:20 
GeneralRe: C# win forms .net core, user control, array on a dialog. Pin
jkirkerx28-Oct-20 6:19
professionaljkirkerx28-Oct-20 6:19 
GeneralRe: C# win forms .net core, user control, array on a dialog. Pin
OriginalGriff28-Oct-20 6:35
mveOriginalGriff28-Oct-20 6:35 
AnswerI think I have it now Pin
jkirkerx28-Oct-20 5:16
professionaljkirkerx28-Oct-20 5:16 
QuestionLinq To SQL - Join To Latest Record Pin
Kevin Marois27-Oct-20 12:27
professionalKevin Marois27-Oct-20 12:27 
AnswerRe: Linq To SQL - Join To Latest Record Pin
pkfox27-Oct-20 22:15
professionalpkfox27-Oct-20 22:15 
QuestionTemporal Nulls in C# Pin
RandyBuchholz27-Oct-20 3:18
RandyBuchholz27-Oct-20 3:18 
AnswerRe: Temporal Nulls in C# Pin
Gerry Schmitz27-Oct-20 4:26
mveGerry Schmitz27-Oct-20 4:26 
AnswerRe: Temporal Nulls in C# Pin
Pete O'Hanlon27-Oct-20 9:55
mvePete O'Hanlon27-Oct-20 9:55 
AnswerRe: Temporal Nulls in C# Pin
BillWoodruff27-Oct-20 10:17
professionalBillWoodruff27-Oct-20 10:17 
QuestionProgramming C # Pin
Immanuel Hitila26-Oct-20 12:10
Immanuel Hitila26-Oct-20 12:10 
AnswerRe: Programming C # Pin
Pete O'Hanlon26-Oct-20 12:16
mvePete O'Hanlon26-Oct-20 12:16 
GeneralRe: Programming C # Pin
Immanuel Hitila26-Oct-20 12:21
Immanuel Hitila26-Oct-20 12:21 
AnswerRe: Programming C # Pin
Richard Andrew x6426-Oct-20 14:06
professionalRichard Andrew x6426-Oct-20 14:06 
AnswerRe: Programming C # Pin
OriginalGriff26-Oct-20 21:14
mveOriginalGriff26-Oct-20 21:14 
QuestionHow to launch a form only once Pin
Ismael_199926-Oct-20 7:57
Ismael_199926-Oct-20 7:57 
Hi, folks.
I’m developing an application in C# using Visual Studio. This application has a parent form from which the user can call other forms. My original problem was: if the user has already launched a form and he clicks again in the menu item to launch the same form, the program should only focus on the form. If the form is not on screen, the program should launch it. Another problem is that I have 1 form that is launched with 2 different data sets (different tables in a DB).
I solved this problem this way: I declared 2 variables for the forms and defined 2 routines:
private void M2_SaidaEfetiva_Click(object sender, EventArgs e)
        {
            if (FormEfetivas == null)
            {
                FormEfetivas = new Frm_Saida();
                FormEfetivas.MdiParent = this;
                FormEfetivas.Text = "Saídas Efetivas";
                FormEfetivas.Tag = "1";
                FormEfetivas.Show();
            }
            FormEfetivas.Activate();
        }
        private void M2_SaidaPrevisao_Click(object sender, EventArgs e)
        {
            if (FormPrevisao == null)
            {
                FormPrevisao = new Frm_Saida();
                FormPrevisao.MdiParent = this;
                FormPrevisao.Text = "Previsão de Saídas";
                FormPrevisao.Tag = "0";
                FormPrevisao.Show();
            }
Now the problem is: when the user opens one form, then closes it, he cannot reopen it again, because the variables (FormEfetivas and FormPrevisao) are not eliminated when the user closes the form.
What am I forgetting here? Can anybody help me?
Thanks.
AnswerRe: How to launch a form only once Pin
OriginalGriff26-Oct-20 8:35
mveOriginalGriff26-Oct-20 8:35 
GeneralRe: How to launch a form only once Pin
Ismael_199926-Oct-20 10:09
Ismael_199926-Oct-20 10:09 
GeneralRe: How to launch a form only once Pin
OriginalGriff26-Oct-20 21:15
mveOriginalGriff26-Oct-20 21:15 

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.