assafey's Profile User Rating: -----

Reputation: 1 Apprentice
Group:
Members
Active Posts:
18 (0.01 per day)
Joined:
08-July 09
Profile Views:
791
Last Active:
User is offline Jun 25 2012 12:40 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0

Latest Visitors

Icon   assafey has not set their status

Posts I've Made

  1. In Topic: Pass pointer to function with parameters to a Thread?

    Posted 14 Jun 2012

    Nevermind
    I figured it by myself. :)
  2. In Topic: Show hidden form1 with code in form2

    Posted 12 May 2012

    Wow thank you!!
    Problem resolved!
  3. In Topic: Show hidden form1 with code in form2

    Posted 11 May 2012

    View PosttlhIn`toq, on 11 May 2012 - 01:01 PM, said:

    View Postassafey, on 11 May 2012 - 12:56 PM, said:

    View PostCurtis Rutland, on 11 May 2012 - 07:37 AM, said:

    Well, there are a few ways. You could pass a reference to the active Form1 using the keyword this to Form2. You'd have to add a parameter or a constructor argument to accept an instance of Form1 to Form2. Then, you can .Show that instance.

    There's another way using events; are you familiar with writing custom events?


    Can I pass form1 to form2 by-ref?
    I need to do changes to it , from Form2 than open form1 with the changes....
    If I pass it by-val chenges wont be shown.
    Is there a way to point (pointer) to Form1?

    View Postcilaes, on 11 May 2012 - 07:40 AM, said:

    Are you using WPF or Windows Forms?


    Windows Forms


    Can you do it? Yes.
    Should you do it? Absolutely not. Its a horrible habit and terrible coding practice. Don't develop these bad habits now.

    Why would you want to? What was wrong with the two recommendatins already made to you?
    • Show the second form as a dialog
    • Respond to an event from the second form when it is closed.


    You're making a simple little app. Don't start covering it in band-aides. Take a moment to learn the right techniques and build your skill level.




    Ok,
    I will try to explain (sorry for my english :) ).
    Form1 has a datagridview, Loading data from a file.
    Form2 is accessible from form1.
    when Form1 and Form2 are shown, the user can control both of them.
    Form2 can open Form3 that changes data in the file.
    Those changes need to be on DGV on Form1 also.
    So after Form3 is closed I'm trying to make changes to Form1 from Form2 even if Form1 is visible false etz...

    So in showdialog(this) when minimized form1, form2 also minimized....
  4. In Topic: Show hidden form1 with code in form2

    Posted 11 May 2012

    View PostCurtis Rutland, on 11 May 2012 - 07:37 AM, said:

    Well, there are a few ways. You could pass a reference to the active Form1 using the keyword this to Form2. You'd have to add a parameter or a constructor argument to accept an instance of Form1 to Form2. Then, you can .Show that instance.

    There's another way using events; are you familiar with writing custom events?


    Can I pass form1 to form2 by-ref?
    I need to do changes to it , from Form2 than open form1 with the changes....
    If I pass it by-val chenges wont be shown.
    Is there a way to point (pointer) to Form1?

    View Postcilaes, on 11 May 2012 - 07:40 AM, said:

    Are you using WPF or Windows Forms?


    Windows Forms

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

assafey hasn't added any friends yet.

Comments

assafey has no profile comments yet. Why not say hello?