Click here to Skip to main content
15,905,427 members
Home / Discussions / C#
   

C#

 
QuestionSecurity Exception Unhandled Pin
Sallu174915-Jul-07 20:14
Sallu174915-Jul-07 20:14 
GeneralRe: Security Exception Unhandled Pin
Sallu174915-Jul-07 22:16
Sallu174915-Jul-07 22:16 
GeneralRe: Security Exception Unhandled Pin
Malcolm Smart16-Jul-07 2:21
Malcolm Smart16-Jul-07 2:21 
AnswerRe: Security Exception Unhandled Pin
mav.northwind16-Jul-07 4:14
mav.northwind16-Jul-07 4:14 
QuestionGet value from other form variable Pin
Edwin Syarief15-Jul-07 18:24
Edwin Syarief15-Jul-07 18:24 
AnswerRe: Get value from other form variable Pin
I.explore.code15-Jul-07 18:53
I.explore.code15-Jul-07 18:53 
GeneralRe: Get value from other form variable Pin
Edwin Syarief15-Jul-07 19:22
Edwin Syarief15-Jul-07 19:22 
AnswerRe: Get value from other form variable Pin
Ravi Bhavnani15-Jul-07 18:54
professionalRavi Bhavnani15-Jul-07 18:54 
To get the value of a variable "V" in form "X" from form "Y", expose V as a public property in X, store a reference to an instance of X in Y, and access it. For example:

public class X : Form
{
  // The public property
  public int V {
    get { return v; }
  }
 
  // Private member variable
  int v = 0;
  ...
}
 
public class Y : Form
{
  // Reference to instance of form X
  X x;
 
  void someMethod()
  {
    // x must have been properly initialized!
    int valueOfVinFormX = x.V;
  }
}
While this is probably the easiest way, it's not the recommended method of accessing data in other forms. But since you're a beginner, I decided to post a simple and direct answer.

/ravi

This is your brain on Celcius
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com

GeneralRe: Get value from other form variable Pin
Edwin Syarief15-Jul-07 19:23
Edwin Syarief15-Jul-07 19:23 
AnswerRe: Get value from other form variable Pin
T.EDY15-Jul-07 19:23
T.EDY15-Jul-07 19:23 
GeneralRe: Get value from other form variable Pin
Edwin Syarief15-Jul-07 19:25
Edwin Syarief15-Jul-07 19:25 
GeneralRe: Get value from other form variable Pin
T.EDY15-Jul-07 19:34
T.EDY15-Jul-07 19:34 
QuestionCustomizing the drag-over cursor Pin
jozsurf15-Jul-07 16:51
jozsurf15-Jul-07 16:51 
AnswerRe: Customizing the drag-over cursor Pin
Eduard Keilholz15-Jul-07 22:51
Eduard Keilholz15-Jul-07 22:51 
GeneralRe: Customizing the drag-over cursor Pin
jozsurf15-Jul-07 23:09
jozsurf15-Jul-07 23:09 
GeneralRe: Customizing the drag-over cursor Pin
Eduard Keilholz15-Jul-07 23:14
Eduard Keilholz15-Jul-07 23:14 
GeneralRe: Customizing the drag-over cursor Pin
jozsurf16-Jul-07 15:29
jozsurf16-Jul-07 15:29 
QuestionCapture Video from Webcam Pin
Le Hoang Viet15-Jul-07 16:39
Le Hoang Viet15-Jul-07 16:39 
AnswerRe: Capture Video from Webcam Pin
Sathesh Sakthivel15-Jul-07 17:17
Sathesh Sakthivel15-Jul-07 17:17 
QuestionImage Question Pin
jason_mf15-Jul-07 16:08
jason_mf15-Jul-07 16:08 
AnswerRe: Image Question Pin
Ravi Bhavnani15-Jul-07 19:00
professionalRavi Bhavnani15-Jul-07 19:00 
Questionserial port read data Pin
ahmad al-omar15-Jul-07 14:40
ahmad al-omar15-Jul-07 14:40 
AnswerRe: serial port read data Pin
Sathesh Sakthivel15-Jul-07 14:45
Sathesh Sakthivel15-Jul-07 14:45 
QuestionRemoting - Watching remote objects... Pin
Shy Agam15-Jul-07 11:14
Shy Agam15-Jul-07 11:14 
AnswerRe: Remoting - Watching remote objects... Pin
Shy Agam15-Jul-07 12:27
Shy Agam15-Jul-07 12:27 

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.