Click here to Skip to main content
15,898,222 members
Home / Discussions / C#
   

C#

 
GeneralRe: uniquely identifies a computer Pin
AndieDu14-Feb-10 16:07
AndieDu14-Feb-10 16:07 
AnswerRe: uniquely identifies a computer Pin
harold aptroot11-Feb-10 23:28
harold aptroot11-Feb-10 23:28 
AnswerRe: uniquely identifies a computer Pin
#realJSOP12-Feb-10 0:09
professional#realJSOP12-Feb-10 0:09 
GeneralRe: uniquely identifies a computer Pin
AndieDu14-Feb-10 16:45
AndieDu14-Feb-10 16:45 
GeneralRe: uniquely identifies a computer Pin
#realJSOP15-Feb-10 1:41
professional#realJSOP15-Feb-10 1:41 
QuestionHow to prevent from open the same form Pin
nuttynibbles11-Feb-10 19:03
nuttynibbles11-Feb-10 19:03 
AnswerRe: How to prevent from open the same form Pin
i gr811-Feb-10 20:06
i gr811-Feb-10 20:06 
AnswerRe: How to prevent from open the same form Pin
thatraja11-Feb-10 20:22
professionalthatraja11-Feb-10 20:22 
assume if you are checking the form "form1", code is below.
C#
public static Form IsFormAlreadyOpen(Type FormType)
{
   foreach (Form OpenForm in Application.OpenForms)
   {
     if (OpenForm.GetType() == FormType)
         return OpenForm;
   }
   return null;
}

        private void button1_Click(object sender, EventArgs e)
        {
            Form frmTest;
            if ((frmTest = IsFormAlreadyOpen(typeof(Form1))) == null)
            {
                frmTest = new Form1();
                frmTest.Show();
            }
            else
            {
                frmTest.WindowState = FormWindowState.Normal;
                frmTest.BringToFront();
            }
        }
this code opens the form if it's not already open otherwise it'll make active form.
thatraja
GeneralRe: How to prevent from open the same form Pin
nuttynibbles11-Feb-10 23:42
nuttynibbles11-Feb-10 23:42 
GeneralRe: How to prevent from open the same form Pin
OriginalGriff11-Feb-10 23:58
mveOriginalGriff11-Feb-10 23:58 
QuestionMultiple Resize events, how to prevent them. Pin
Douglas Kirk11-Feb-10 18:59
Douglas Kirk11-Feb-10 18:59 
AnswerRe: Multiple Resize events, how to prevent them. Pin
OriginalGriff11-Feb-10 21:59
mveOriginalGriff11-Feb-10 21:59 
QuestionNightmare with Regular Expression Pin
newproger11-Feb-10 16:19
newproger11-Feb-10 16:19 
JokeRe: Nightmare with Regular Expression Pin
Dan Mos11-Feb-10 16:23
Dan Mos11-Feb-10 16:23 
AnswerRe: Nightmare with Regular Expression Pin
AspDotNetDev11-Feb-10 16:28
protectorAspDotNetDev11-Feb-10 16:28 
GeneralRe: Nightmare with Regular Expression Pin
newproger11-Feb-10 16:37
newproger11-Feb-10 16:37 
AnswerRe: Nightmare with Regular Expression Pin
Dan Mos11-Feb-10 17:56
Dan Mos11-Feb-10 17:56 
Questioncreating dynamic array Pin
nuttynibbles11-Feb-10 15:32
nuttynibbles11-Feb-10 15:32 
AnswerRe: creating dynamic array Pin
Dan Mos11-Feb-10 16:00
Dan Mos11-Feb-10 16:00 
GeneralRe: creating dynamic array Pin
nuttynibbles11-Feb-10 16:22
nuttynibbles11-Feb-10 16:22 
GeneralRe: creating dynamic array Pin
Dave Kreskowiak11-Feb-10 18:14
mveDave Kreskowiak11-Feb-10 18:14 
GeneralRe: creating dynamic array Pin
nuttynibbles11-Feb-10 19:03
nuttynibbles11-Feb-10 19:03 
GeneralRe: creating dynamic array Pin
i gr811-Feb-10 20:09
i gr811-Feb-10 20:09 
GeneralRe: creating dynamic array Pin
Dave Kreskowiak12-Feb-10 1:15
mveDave Kreskowiak12-Feb-10 1:15 
GeneralRe: creating dynamic array Pin
Dave Doknjas12-Feb-10 11:35
Dave Doknjas12-Feb-10 11:35 

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.