Click here to Skip to main content
15,885,278 members
Home / Discussions / C#
   

C#

 
GeneralRe: Talking to a telnet server Pin
shultas9-Aug-09 10:00
shultas9-Aug-09 10:00 
GeneralRe: Talking to a telnet server Pin
Luc Pattyn9-Aug-09 10:30
sitebuilderLuc Pattyn9-Aug-09 10:30 
GeneralRe: Talking to a telnet server Pin
Randor 9-Aug-09 10:32
professional Randor 9-Aug-09 10:32 
Question[Message Deleted] Pin
spankyleo1239-Aug-09 6:13
spankyleo1239-Aug-09 6:13 
AnswerRe: InsertOnSubmit error Pin
Luc Pattyn9-Aug-09 6:28
sitebuilderLuc Pattyn9-Aug-09 6:28 
General[Message Deleted] Pin
spankyleo1239-Aug-09 6:35
spankyleo1239-Aug-09 6:35 
GeneralRe: InsertOnSubmit error Pin
Luc Pattyn9-Aug-09 6:41
sitebuilderLuc Pattyn9-Aug-09 6:41 
QuestionForms overlapping Pin
Xmen Real 9-Aug-09 5:16
professional Xmen Real 9-Aug-09 5:16 
I've 3 forms, the first one has a button that shows Form2 and in Form2's Load event Form3 shows.
Now the thing is that if I call f2.Show(); from Form1's button then everything works fine but when I call f2.ShowDialog(); then the Form3 get behind the Form1 even Form2 has activated. Here is the code

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent(); //Requires a button
    }

    private void button1_Click(object sender, EventArgs e)
    {
        Form2 f2 = new Form2();
        //f2.Show();
        f2.ShowDialog();
    }
}



public partial class Form2 : Form
{
    public Form2()
    {
        InitializeComponent();
    }
    Form3 f3 = new Form3();
    private void Form2_Load(object sender, EventArgs e)
    {
        f3.Show();
    }
    bool isJustActivated = false;
    private void Form2_Activated(object sender, EventArgs e)
    {
        if (!isJustActivated)
        {
            isJustActivated = true;
            f3.Activate();

            bool tmp_holdValue = this.TopMost;
            this.TopMost = true; //get back the focus
            this.TopMost = tmp_holdValue;
        }
        else
            isJustActivated = false;
    }



public partial class Form3 : Form
{
    public Form3()
    {
        InitializeComponent();
        this.BackColor = Color.Green; //a green square form to identify it clearly
        this.FormBorderStyle = FormBorderStyle.None;
    }
}


I want that Form3 should always be above the Form1...


Updated :
Correct overlap[^]
Wrong overlap screenshot[^]
as you can see the first screenshot(correct) has Form3
(Green) above Form1 but in the second where Form3 is behind the Form1(because Form2 called by ShowDialog())



TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKQUFK[M`UKs*$GwU#QDXBER@CBN%
R0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia>

-----------------------------------------------
128 bit encrypted signature, crack if you can

AnswerRe: Forms overlapping Pin
pelnor9-Aug-09 5:28
pelnor9-Aug-09 5:28 
GeneralRe: Forms overlapping Pin
Luc Pattyn9-Aug-09 5:59
sitebuilderLuc Pattyn9-Aug-09 5:59 
GeneralRe: Forms overlapping Pin
pelnor9-Aug-09 6:10
pelnor9-Aug-09 6:10 
GeneralRe: Forms overlapping Pin
Xmen Real 9-Aug-09 6:22
professional Xmen Real 9-Aug-09 6:22 
AnswerRe: Forms overlapping Pin
Luc Pattyn9-Aug-09 6:34
sitebuilderLuc Pattyn9-Aug-09 6:34 
GeneralRe: Forms overlapping Pin
Xmen Real 9-Aug-09 7:46
professional Xmen Real 9-Aug-09 7:46 
GeneralRe: Forms overlapping Pin
Luc Pattyn9-Aug-09 7:53
sitebuilderLuc Pattyn9-Aug-09 7:53 
GeneralRe: Forms overlapping Pin
Xmen Real 9-Aug-09 7:55
professional Xmen Real 9-Aug-09 7:55 
AnswerRe: Forms overlapping Pin
Alan N9-Aug-09 9:06
Alan N9-Aug-09 9:06 
GeneralRe: Forms overlapping Pin
Xmen Real 9-Aug-09 15:06
professional Xmen Real 9-Aug-09 15:06 
GeneralRe: Forms overlapping [SOLVED] Pin
Xmen Real 9-Aug-09 15:33
professional Xmen Real 9-Aug-09 15:33 
AnswerRe: Forms overlapping Pin
Luc Pattyn9-Aug-09 10:27
sitebuilderLuc Pattyn9-Aug-09 10:27 
GeneralRe: Forms overlapping Pin
Xmen Real 9-Aug-09 15:36
professional Xmen Real 9-Aug-09 15:36 
QuestionHelp needed in C# - Mobile App Development Pin
Member 1152439-Aug-09 4:44
Member 1152439-Aug-09 4:44 
AnswerRe: Help needed in C# - Mobile App Development Pin
Not Active9-Aug-09 4:54
mentorNot Active9-Aug-09 4:54 
QuestionMenuStrip sub item added event Pin
Xmen Real 9-Aug-09 4:37
professional Xmen Real 9-Aug-09 4:37 
AnswerRe: MenuStrip sub item added event Pin
Richard Blythe9-Aug-09 9:20
Richard Blythe9-Aug-09 9:20 

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.