RSS Forums RSS
Please support our C# advertiser: Programming Forums
Views: 5993 | Replies: 0
Reply
Join Date: Jan 2006
Posts: 26
Reputation: daidaiboyboy is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
daidaiboyboy daidaiboyboy is offline Offline
Light Poster

Calling function in a child window from main parent window

  #1  
Mar 12th, 2006
Hi all...

This is the case:

I have a main parent window, and a child window inside it.
The parent window consists of a menubar, whereby clicking one of its menu item (mnuSave) is supposed to save the graph drawn inside the child window. The code for saving the graph is done by a method called SaveGraph(). I tried calling the method from the main parent window, but then an error occured saying "TestProg.ChildWin.zedGraphControl1" denotes a 'field' where a 'class' was expected.

The following illustrates better :

Inside parent window (TestProg)

private void mnuSave_Click(object sender, System.EventArgs e)
{
ChildWin selectedView = (ChildWin)this.ActiveMdiChild;
ChildWin.SaveGraph();
}

Inside the child window (ChildWin)

public static void SaveGraph()
{
zedGraphControl1.GraphPane.Image.Save(@"\My Documents\Visual Studio Projects\image.png", System.Drawing.Imaging.ImageFormat.Png);
}

The zedGraphControl1 is one drawing graph control from zedGraph, a useful graph drawing plugin for C#. What should I do in this case?
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 1:52 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC