Click here to Skip to main content
15,896,522 members
Home / Discussions / C#
   

C#

 
QuestionGraphic problem? Pin
Alan Zhao7-May-04 11:48
Alan Zhao7-May-04 11:48 
AnswerRe: Graphic problem? Pin
kayhustle7-May-04 14:19
kayhustle7-May-04 14:19 
GeneralUpload Very Large Files to SQL Server Pin
Adam Hable7-May-04 11:42
Adam Hable7-May-04 11:42 
GeneralRe: Upload Very Large Files to SQL Server Pin
leppie7-May-04 13:49
leppie7-May-04 13:49 
GeneralRe: Upload Very Large Files to SQL Server Pin
Colin Angus Mackay7-May-04 23:59
Colin Angus Mackay7-May-04 23:59 
Questionhow can I get post or get data that send by "Microsoft Web Browser" Pin
Renegade_c7-May-04 11:12
Renegade_c7-May-04 11:12 
GeneralPassing Public int Variable to Win Form Pin
Dave Brighton7-May-04 10:53
Dave Brighton7-May-04 10:53 
GeneralRe: Passing Public int Variable to Win Form Pin
Colin Angus Mackay7-May-04 13:02
Colin Angus Mackay7-May-04 13:02 
Please don't take my response the wrong way, I am trying to help by finding out what you are trying to achieve, however your initial posting is somewhat vague.

kd7gim wrote:
I would like to pass a public integer variable from a C#.Net Win Form to another C#.Net Win Form within the same project

First off. It is really really bad practice to declare member variables in a class as public (You also mention C++ and it is bad practice there too - Remember that just because a programming language allows you to do something doesn't mean that it is a good idea to do it.). You are right to want to use the get/set property accessors.

kd7gim wrote:
am thinking that maybe I should pass by reference instead of pass by value

You don't explain why you'd want to do that, so I am going to assume that since you only mention passing from one class to another (but you didn't mention passing it back again) that this is grasping at straws. Passing by reference is somewhat similar to passing a pointer in C++.

kd7gim wrote:
There is so much difference between SDK Compiler code, and Visual Studio Win Form code

Confused | :confused: Is there?

You haven't mentioned anything about your design so I really don't know how these two classes are interacting (or supposed to interact). There are countless ways to pass an integer value from one class to another. For example, a constructor could be create that take the integer value, a setter property in the second class could accept the integer from a method in the first class, a getter in the first class could reveal the value to a method in the second class, a method call to the second class could accept the integer, the second class could have an event handler where the integer is part of the event arguments, etc. etc. etc.

Anyway, I hope you can post back with more detail as it will help greatly with finding a solution.


"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 Brighton7-May-04 14:11
Dave Brighton7-May-04 14:11 
GeneralRe: Passing Public int Variable to Win Form Pin
Colin Angus Mackay7-May-04 23:49
Colin Angus Mackay7-May-04 23:49 
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 

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.