Click here to Skip to main content
15,918,243 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to read files using FolderBrowserDialog and save its contents into sql database table Pin
King Julien27-Mar-09 3:48
King Julien27-Mar-09 3:48 
GeneralRe: How to read files using FolderBrowserDialog and save its contents into sql database table Pin
0x3c027-Mar-09 4:39
0x3c027-Mar-09 4:39 
AnswerRe: How to read files using FolderBrowserDialog and save its contents into sql database table Pin
Giorgi Dalakishvili26-Mar-09 22:38
mentorGiorgi Dalakishvili26-Mar-09 22:38 
QuestionCall event after closing my last form but not the main form? Pin
lixid26-Mar-09 19:02
lixid26-Mar-09 19:02 
AnswerRe: Call event after closing my last form but not the main form? Pin
King Julien26-Mar-09 19:35
King Julien26-Mar-09 19:35 
GeneralRe: Call event after closing my last form but not the main form? Pin
lixid26-Mar-09 19:56
lixid26-Mar-09 19:56 
GeneralRe: Call event after closing my last form but not the main form? Pin
King Julien26-Mar-09 20:18
King Julien26-Mar-09 20:18 
GeneralRe: Call event after closing my last form but not the main form? Pin
lixid27-Mar-09 20:09
lixid27-Mar-09 20:09 
Thanks the answer helped but I solved it by doing this.
Thanks to a post here http://forum.codecall.net/c-programming/515-c-calling-parent-functions-child-form.html#post2214[^]
Void's post...

-Example-
MainForm Code:

namespace CallParentFuncFromChildChild
{
    public partial class MainForm : Form
    {

        public MainForm()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Child1 child1 = new Child1(this);
            child1.Show();
        }

        public void msgme()
        {
            //You could put anything you wanted to execute in here.
            //Like updating a label with values in an xml file that was updated by the SubChild1 form.
            MessageBox.Show("Parent Function Called");
        }
    }
}



Child1 Code:

namespace CallParentFuncFromChildChild
{
    public partial class Child1 : Form
    {
        private MainForm m_mainForm;

        public Child1(MainForm mainForm)
        {
            InitializeComponent();
            m_mainForm = mainForm;

        }

        private void button1_Click(object sender, EventArgs e)
        {
            SubChild1 subChild1 = new SubChild1(m_mainForm);
            subChild1.Show();
            this.Close();
        }
    }
}


SubChild1 Code:

namespace CallParentFuncFromChildChild
{
    public partial class SubChild1 : Form
    {
        private MainForm m_mainForm;

        public SubChild1(MainForm mainForm)
        {
            InitializeComponent();
            m_mainForm = mainForm;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //Execute MainForm function from here
            m_mainForm.msgme();
            this.Close();
        }
    }
}


Thanks again for the help and I hope this helps someone. :]
QuestionNeed help with some basic problems Pin
RogerLum26-Mar-09 17:37
RogerLum26-Mar-09 17:37 
AnswerRe: Need help with some basic problems Pin
Dave Kreskowiak26-Mar-09 18:14
mveDave Kreskowiak26-Mar-09 18:14 
GeneralRe: Need help with some basic problems Pin
RogerLum26-Mar-09 19:10
RogerLum26-Mar-09 19:10 
GeneralRe: Need help with some basic problems Pin
King Julien26-Mar-09 19:39
King Julien26-Mar-09 19:39 
GeneralRe: Need help with some basic problems Pin
Tom Deketelaere26-Mar-09 22:31
professionalTom Deketelaere26-Mar-09 22:31 
GeneralRe: Need help with some basic problems Pin
Dave Kreskowiak27-Mar-09 1:26
mveDave Kreskowiak27-Mar-09 1:26 
AnswerRe: Need help with some basic problems Pin
12Code26-Mar-09 19:41
12Code26-Mar-09 19:41 
GeneralRe: Need help with some basic problems Pin
RogerLum26-Mar-09 20:07
RogerLum26-Mar-09 20:07 
GeneralRe: Need help with some basic problems Pin
Christian Graus26-Mar-09 21:57
protectorChristian Graus26-Mar-09 21:57 
GeneralRe: Need help with some basic problems Pin
Tom Deketelaere26-Mar-09 22:34
professionalTom Deketelaere26-Mar-09 22:34 
AnswerRe: Need help with some basic problems Pin
benjymous27-Mar-09 0:49
benjymous27-Mar-09 0:49 
Questionusing SendMessage win32 things Pin
jeanbern26-Mar-09 16:03
jeanbern26-Mar-09 16:03 
AnswerRe: using SendMessage win32 things Pin
Dave Kreskowiak26-Mar-09 18:12
mveDave Kreskowiak26-Mar-09 18:12 
AnswerRe: using SendMessage win32 things Pin
Judah Gabriel Himango26-Mar-09 18:15
sponsorJudah Gabriel Himango26-Mar-09 18:15 
GeneralRe: using SendMessage win32 things Pin
jeanbern26-Mar-09 18:39
jeanbern26-Mar-09 18:39 
Questioncast to interface and then pass as ref Pin
devvvy26-Mar-09 14:18
devvvy26-Mar-09 14:18 
AnswerRe: cast to interface and then pass as ref Pin
_Maxxx_26-Mar-09 19:31
professional_Maxxx_26-Mar-09 19:31 

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.