Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have two forms.
First form displays controls and calculate button.
Second form contains Gif image of processing bar and this form is opened using thread.
when i click on calculate button i displays processing form (second form using thread).
But these two forms are shown as seperate forms when i press Alt+Tab key,
So how can i make these two forms as single unit, so that it displays single form in Alt+Tab .

Refer following calculate button click event:-

C#
private void btnCalculate_Click(object sender, EventArgs e)
        {
            //display Processing form (shows processing.gif image)
            //call calculation function
            //close Processing form
        }
Posted
Updated 30-Jan-14 19:18pm
v2

Set the 'ShowInTaskBar Property of the second Form to 'false so it will not appear in the TaskBar, or appear when you use Alt-Tab.

You might want to be sure and set the second Form's 'TopMost property to 'true to make sure it stays in front of the first Form.

I'm not sure exactly what you mean by "appear as a single unit," but you can make the second Form appear rather "bare" by setting its 'FormBorderStyle to 'FixedToolWindow, setting its 'Text Property to an empty string, setting the 'ControlBox property to 'false.
 
Share this answer
 
v2
use ShowDialog[^] instead of Show()

C#
Form2 obj = new Form2();
            obj.ShowDialog();
 
Share this answer
 
Comments
RhishikeshLathe 31-Jan-14 1:17am    
after showing processing bar there is code of calculations.
if i use showDialog() method execution stops there.
please go through following snippet:-

private void btnCalculate_Click(object sender, EventArgs e)
{
//display Processing form (shows processing.gif image)
//call calculation function
//close Processing form
}
Karthik_Mahalingam 31-Jan-14 1:20am    
make the FormBorderStyle as None
System.Windows.Forms.FormBorderStyle.None
or else
create a panel and make it visible/hide..

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900