Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
AnswerRe: Form Pin
EliottA11-Feb-09 2:40
EliottA11-Feb-09 2:40 
AnswerRe: Form Pin
musefan11-Feb-09 2:48
musefan11-Feb-09 2:48 
GeneralRe: Form Pin
mrithula811-Feb-09 2:51
mrithula811-Feb-09 2:51 
GeneralRe: Form Pin
musefan11-Feb-09 3:00
musefan11-Feb-09 3:00 
AnswerRe: Form Pin
Alan N11-Feb-09 3:35
Alan N11-Feb-09 3:35 
GeneralRe: Form Pin
mrithula811-Feb-09 18:16
mrithula811-Feb-09 18:16 
GeneralRe: Form [modified] Pin
Alan N12-Feb-09 0:30
Alan N12-Feb-09 0:30 
Answerit is easy look here Pin
erfi12-Feb-09 0:27
erfi12-Feb-09 0:27 
you should use an IntPtr variable in form2 to hold the Handle of form1 :
public partial class Form1 : Form
{
    Form2 form2;

    public Form1()
    {
        InitializeComponent();
        form2 = new Form2(this.Handle);
    }

    private void button1_Click(object sender, EventArgs e)
    {
        this.Hide();
        form2.Show();
    }
}

and
public partial class Form2 : Form
{
    private IntPtr friendHandle;

    public Form2(IntPtr hnd)
    {
        InitializeComponent();

        friendHandle = hnd;
    }

    private void button1_Click(object sender, EventArgs e)
    {
        this.Hide();
        Form.FromHandle(friendHandle).Show();
    }
}


this works fine. i tried
if you want to the information in the forms to be saved you souldn't make a new instance of forms in click event but if you don't need them then you are free to do it Laugh | :laugh:

sometimes 0 can be 1

QuestionRE: Datagrid with check box Pin
chandhuBTS11-Feb-09 1:36
chandhuBTS11-Feb-09 1:36 
QuestionCarraige Return Issue Pin
MumbleB11-Feb-09 1:34
MumbleB11-Feb-09 1:34 
AnswerRe: Carraige Return Issue [modified] Pin
ABitSmart11-Feb-09 1:44
ABitSmart11-Feb-09 1:44 
AnswerRe: Carraige Return Issue Pin
musefan11-Feb-09 1:49
musefan11-Feb-09 1:49 
AnswerRe: Carraige Return Issue Pin
Guffa11-Feb-09 2:01
Guffa11-Feb-09 2:01 
GeneralRe: Carraige Return Issue Pin
MumbleB11-Feb-09 2:10
MumbleB11-Feb-09 2:10 
GeneralRe: Carraige Return Issue Pin
Guffa11-Feb-09 6:34
Guffa11-Feb-09 6:34 
AnswerRe: Carraige Return Issue Pin
Luc Pattyn11-Feb-09 11:44
sitebuilderLuc Pattyn11-Feb-09 11:44 
JokeRe: Carraige Return Issue Pin
Guffa12-Feb-09 19:28
Guffa12-Feb-09 19:28 
QuestionC# Image Printing Pin
scotlandc11-Feb-09 1:27
scotlandc11-Feb-09 1:27 
AnswerRe: C# Image Printing Pin
musefan11-Feb-09 1:38
musefan11-Feb-09 1:38 
GeneralRe: C# Image Printing Pin
scotlandc11-Feb-09 1:41
scotlandc11-Feb-09 1:41 
GeneralRe: C# Image Printing Pin
musefan11-Feb-09 1:46
musefan11-Feb-09 1:46 
QuestionARRAY LIST TO STRING Pin
lawrenceinba11-Feb-09 1:02
lawrenceinba11-Feb-09 1:02 
AnswerRe: ARRAY LIST TO STRING Pin
Kristian Sixhøj11-Feb-09 1:06
Kristian Sixhøj11-Feb-09 1:06 
AnswerRe: ARRAY LIST TO STRING Pin
musefan11-Feb-09 1:13
musefan11-Feb-09 1:13 
GeneralRe: ARRAY LIST TO STRING Pin
Deresen11-Feb-09 10:36
Deresen11-Feb-09 10:36 

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.