Click here to Skip to main content
15,922,419 members
Home / Discussions / C#
   

C#

 
GeneralRe: Passing Public int Variable to Win Form Pin
Colin Angus Mackay7-May-04 23:49
Colin Angus Mackay7-May-04 23:49 
kd7gim wrote:
I have a C# application I have already written, and I am adding a MDI Graph page.

Okay, sounds reasonable.

kd7gim wrote:
The graph page is already written, and the parent document is a C# Data Base Management System

Document? Did you ever program with MFC? WinForms applications don't have anything equivalent to the MFC's Document/View implementation of the MVC (Model/View/Controller) pattern, so you generally have to roll your own.

kd7gim wrote:
load data onto a stack

A stack? Do you mean a System.Collections.Stack[^] object? If so, why?

If not, then remember that all object except for intrisnsic objects and other value types (like Point, DateTime, etc.) are created on the heap in C#.

In your original post, you asked about passing an integer between two classes (specifically Form classes). Now that I know one is an MDI Parent Form and one is an MDI Child Form I can show you at least one possible example:

In the parent MDI form you will have some method that needs to send data to the child MDI form. So some piece of code like:
MyGraphFormInstance.MyDataValue = someDataValue;

In the child MDI form you will have a corresponding piece of code ready to receive this data, something like:
public int MyData
{
	get
	{
		// Do something with the value
	}
	set
	{
		// Include a setter if the value will be modified
		// and needs to be retrieved from outside this instance
	}
}

Or you may like to implement the above getter as a method and send multiple items of data at the same time, or have some return value sent back to indicate some change in state. It depends on what you need to do.

Does this help?


"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar

Coming soon: The Second EuroCPian Event


GeneralRe: Passing Public int Variable to Win Form Pin
Dave Brighton8-May-04 6:12
Dave Brighton8-May-04 6:12 
GeneralRe: Passing Public int Variable to Win Form Pin
Colin Angus Mackay8-May-04 6:48
Colin Angus Mackay8-May-04 6:48 
GeneralChanging the fugly Setup Wizard icon in MSI files. Pin
Tony Archer7-May-04 9:14
Tony Archer7-May-04 9:14 
GeneralRe: Changing the fugly Setup Wizard icon in MSI files. Pin
Heath Stewart7-May-04 9:45
protectorHeath Stewart7-May-04 9:45 
GeneralRe: Changing the fugly Setup Wizard icon in MSI files. Pin
Tony Archer7-May-04 13:54
Tony Archer7-May-04 13:54 
GeneralPassing collection via Web Services Pin
Diego F.7-May-04 8:32
Diego F.7-May-04 8:32 
GeneralRe: Passing collection via Web Services Pin
Heath Stewart7-May-04 9:40
protectorHeath Stewart7-May-04 9:40 
GeneralRe: Passing collection via Web Services Pin
Diego F.7-May-04 12:33
Diego F.7-May-04 12:33 
GeneralRe: Passing collection via Web Services Pin
Heath Stewart8-May-04 19:27
protectorHeath Stewart8-May-04 19:27 
GeneralRe: Passing collection via Web Services Pin
Dave Brighton21-Jun-04 1:15
Dave Brighton21-Jun-04 1:15 
GeneralPassing params to an embedded control in IE Pin
TigerNinja_7-May-04 8:22
TigerNinja_7-May-04 8:22 
GeneralRe: Passing params to an embedded control in IE Pin
Heath Stewart7-May-04 9:37
protectorHeath Stewart7-May-04 9:37 
GeneralRe: Passing params to an embedded control in IE Pin
TigerNinja_7-May-04 10:57
TigerNinja_7-May-04 10:57 
GeneralRe: Passing params to an embedded control in IE Pin
TigerNinja_18-May-04 8:34
TigerNinja_18-May-04 8:34 
GeneralRe: Passing params to an embedded control in IE Pin
Heath Stewart18-May-04 9:24
protectorHeath Stewart18-May-04 9:24 
Questionhow can I clear out null characters in a string var? Pin
djkno37-May-04 8:03
djkno37-May-04 8:03 
AnswerRe: how can I clear out null characters in a string var? Pin
Jeff Varszegi7-May-04 8:15
professionalJeff Varszegi7-May-04 8:15 
GeneralRe: how can I clear out null characters in a string var? Pin
djkno37-May-04 8:17
djkno37-May-04 8:17 
GeneralA theoretical question involving Direct3D Pin
Andres Coder7-May-04 7:59
Andres Coder7-May-04 7:59 
GeneralRe: A theoretical question involving Direct3D Pin
TigerNinja_7-May-04 8:26
TigerNinja_7-May-04 8:26 
GeneralRe: A theoretical question involving Direct3D Pin
Heath Stewart7-May-04 9:32
protectorHeath Stewart7-May-04 9:32 
GeneralRe: A theoretical question involving Direct3D Pin
Dave Brighton21-Jun-04 1:20
Dave Brighton21-Jun-04 1:20 
QuestionHow do I send messages to another form Pin
kayhustle7-May-04 7:31
kayhustle7-May-04 7:31 
AnswerRe: How do I send messages to another form Pin
CWIZO7-May-04 7:39
CWIZO7-May-04 7:39 

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.