| | |
Calling function in a child window from main parent window
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
Join Date: Jan 2006
Posts: 26
Reputation:
Solved Threads: 0
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)
Inside the child window (ChildWin)
The zedGraphControl1 is one drawing graph control from zedGraph, a useful graph drawing plugin for C#. What should I do in this case?
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)
C# Syntax (Toggle Plain Text)
private void mnuSave_Click(object sender, System.EventArgs e) { ChildWin selectedView = (ChildWin)this.ActiveMdiChild; ChildWin.SaveGraph(); }
Inside the child window (ChildWin)
C# Syntax (Toggle Plain Text)
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?
![]() |
Similar Threads
- Parent/Child Windows References (JavaScript / DHTML / AJAX)
- Helping with calling a function (C)
- Calling C function from MATLAB (C)
- Control Child Window After parent refresh W/O Frames (HTML and CSS)
- Datagrid to draw a table (C#)
- How do I Execute multi programs (Visual Basic 4 / 5 / 6)
- Listeners (Java)
- "cannot resolve symbol"problem (Java)
- Still need info on calling a function from bool! (C++)
Other Threads in the C# Forum
- Previous Thread: C# VS 2005 - SQL Query Parameters to an ODBC DataSource
- Next Thread: Creating a setup project using Setup Project Wizard
| Thread Tools | Search this Thread |
.net access algorithm angle array asp.net bitmap box broadcast c# capturing check checkbox client combobox control conversion csharp database databasesearch datagrid datagridview dataset datetime dbconnection degrees delegate design development disappear draganddrop drawing encryption enum eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net image input install interface java libraries list loop marshalbyrefobject math monodevelop mouseclick movingimage msword mysql operator path pause photoshop php picturebox pixelinversion platform post programming radians regex remoting richtextbox server sleep socket sql statistics string study system.servicemodel table tcpclientchannel text textbox thread time timer update usb usercontrol validation virtualization visualbasic visualstudio webbrowser winforms wpf wpfc# xml





