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

C#

 
Questionplaying rmvb videos using csharp.net Pin
zumty17-Aug-08 13:44
zumty17-Aug-08 13:44 
AnswerRe: playing rmvb videos using csharp.net Pin
DeepToot17-Aug-08 13:56
DeepToot17-Aug-08 13:56 
GeneralRe: playing rmvb videos using csharp.net Pin
zumty17-Aug-08 20:48
zumty17-Aug-08 20:48 
QuestionNeed advice on light weight database-like design Pin
DeepToot17-Aug-08 13:37
DeepToot17-Aug-08 13:37 
AnswerRe: Need advice on light weight database-like design Pin
N a v a n e e t h17-Aug-08 19:40
N a v a n e e t h17-Aug-08 19:40 
QuestionCheck if form is open? Pin
Arcdigital17-Aug-08 11:37
Arcdigital17-Aug-08 11:37 
AnswerRe: Check if form is open? Pin
lisan_al_ghaib17-Aug-08 12:37
lisan_al_ghaib17-Aug-08 12:37 
AnswerRe: Check if form is open? another way Pin
Natza Mitzi17-Aug-08 13:45
Natza Mitzi17-Aug-08 13:45 
Hi,
In this way you either create or show the form without using events.
On click the ShowChild method is called.
Test for null or disposed and show it if this is the case.
If the form is ok we test if it is minimized then we restore it and then bring it to the front.
Note that Show brings the form to the front only on the first call.
Note - DO NOT CALL ShowDialog - it does not work if the form has been shown before Your application will crash with an InvalidOperationException

public partial class Form1 : Form
{
private Form childForm;

public Form1()
{
InitializeComponent();
}

private void ShowChild()
{
if (childForm == null || childForm.IsDisposed)
{
childForm = new Form2();
childForm.Show();
}
else
{
if (childForm.WindowState == FormWindowState.Minimized)
{
childForm.WindowState = FormWindowState.Normal;
}

childForm.BringToFront();

}
}

private void buttonShow_Click(object sender, EventArgs e)
{
ShowChild();
}
}

Natza Mitzi
QuestionCasting from a Base to Derived Class Pin
Jammer17-Aug-08 8:21
Jammer17-Aug-08 8:21 
AnswerRe: Casting from a Base to Derived Class Pin
Pete O'Hanlon17-Aug-08 8:34
mvePete O'Hanlon17-Aug-08 8:34 
AnswerRe: Casting from a Base to Derived Class Pin
Wendelius17-Aug-08 8:37
mentorWendelius17-Aug-08 8:37 
GeneralRe: Casting from a Base to Derived Class Pin
Jammer17-Aug-08 9:25
Jammer17-Aug-08 9:25 
GeneralRe: Casting from a Base to Derived Class Pin
Jammer17-Aug-08 9:30
Jammer17-Aug-08 9:30 
GeneralRe: Casting from a Base to Derived Class Pin
Wendelius17-Aug-08 9:52
mentorWendelius17-Aug-08 9:52 
GeneralRe: Casting from a Base to Derived Class Pin
Jammer17-Aug-08 10:15
Jammer17-Aug-08 10:15 
GeneralRe: Casting from a Base to Derived Class Pin
Wendelius17-Aug-08 10:17
mentorWendelius17-Aug-08 10:17 
QuestionHow to Bind combobox to Datatable coloums in connected mode??(Windows application) Pin
rahul2117-Aug-08 6:00
rahul2117-Aug-08 6:00 
AnswerRe: How to Bind combobox to Datatable coloums in connected mode??(Windows application) Pin
Manas Bhardwaj17-Aug-08 6:40
professionalManas Bhardwaj17-Aug-08 6:40 
AnswerRe: How to Bind combobox to Datatable coloums in connected mode??(Windows application) Pin
N a v a n e e t h17-Aug-08 7:04
N a v a n e e t h17-Aug-08 7:04 
QuestionSendKeys and ^ Pin
Dominik Reichl17-Aug-08 2:16
Dominik Reichl17-Aug-08 2:16 
AnswerRe: SendKeys and ^ Pin
Wendelius17-Aug-08 3:04
mentorWendelius17-Aug-08 3:04 
QuestionRe: SendKeys and ^ Pin
Dominik Reichl17-Aug-08 3:59
Dominik Reichl17-Aug-08 3:59 
AnswerRe: SendKeys and ^ Pin
Wendelius17-Aug-08 4:31
mentorWendelius17-Aug-08 4:31 
QuestionImplementing IDisposable in Sealed class Pin
Blumen17-Aug-08 0:48
Blumen17-Aug-08 0:48 
AnswerRe: Implementing IDisposable in Sealed class Pin
Colin Angus Mackay17-Aug-08 0:59
Colin Angus Mackay17-Aug-08 0:59 

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.