Click here to Skip to main content
15,886,919 members
Home / Discussions / C#
   

C#

 
QuestionSet Focus on win application Pin
Prasanna ragav3-Dec-12 22:03
Prasanna ragav3-Dec-12 22:03 
Questionquestions about SerialPort in VS2010 ? Pin
nqchanh3-Dec-12 21:13
nqchanh3-Dec-12 21:13 
AnswerRe: questions about SerialPort in VS2010 ? Pin
Richard MacCutchan3-Dec-12 21:45
mveRichard MacCutchan3-Dec-12 21:45 
GeneralRe: questions about SerialPort in VS2010 ? Pin
nqchanh3-Dec-12 21:55
nqchanh3-Dec-12 21:55 
GeneralRe: questions about SerialPort in VS2010 ? Pin
Richard MacCutchan3-Dec-12 22:55
mveRichard MacCutchan3-Dec-12 22:55 
QuestionHelp,How to Convert the Array,Collection,DataTable Or DataSet to Xml File? Pin
Jandren3-Dec-12 18:56
Jandren3-Dec-12 18:56 
AnswerRe: Help,How to Convert the Array,Collection,DataTable Or DataSet to Xml File? Pin
Richard MacCutchan3-Dec-12 21:41
mveRichard MacCutchan3-Dec-12 21:41 
QuestionAccessing Form Elements From Different Files Pin
C-P-User-33-Dec-12 14:54
C-P-User-33-Dec-12 14:54 
Item 1: I do not want large source files.

Item 2: I have some rectangles on my Form.

Item 3: I want to access the rectangles, for graphing, from other files.

Can someone direct me to some sort of explanation me how that's done ?

Certainly this is common practice; but I can't find it clearly documented in websites, videos, whatever.

------
Details
------

If I have a file called GraphClassesAndMethods.cs, and I want to, say, put a dot or a line on a rectangle which I designed with the C# toolbox, then how do I get C# to let my class and method in this file see the rectangle ?

C# knows that they are there when I'm typing in the Form1.cs file, and I wrongly inferred/guessed that the reason that it couldn't see the same rectangle in the graphClassesAndMethods files was because the class had a different name.

To test this, I put a class and method outside the Form1 class (in the Form1.cs file) and Ta-Da, the rectangles were not visible to code in that class. So I thought (wrongly) that if I put the same class name in the other file, then they would be visible.

No.


One "solution" to this problem is to create a ridiculously large amount of source in the file Form1.cs, in which case we will have a blob that works once, version 1.0, and will require three years to implement the simplest little change.

Request: Someone please explain to me how to let my code (i.e., in the other file) see the rectangles which are perfectly visible to code that I type in the Form1 class in the Form1.cs file.

Of particular interest to me is that I would like to also have an InitEverything.cs file where I can put all the "ooops, that should have been done first" routines and so on which tend to crop up during the last 10% of the coding.
AnswerRe: Accessing Form Elements From Different Files Pin
Mycroft Holmes3-Dec-12 16:14
professionalMycroft Holmes3-Dec-12 16:14 
AnswerRe: Accessing Form Elements From Different Files Pin
PIEBALDconsult3-Dec-12 16:16
mvePIEBALDconsult3-Dec-12 16:16 
AnswerRe: Accessing Form Elements From Different Files Pin
Gerry Schmitz3-Dec-12 21:02
mveGerry Schmitz3-Dec-12 21:02 
GeneralRe: Accessing Form Elements From Different Files Pin
C-P-User-34-Dec-12 3:24
C-P-User-34-Dec-12 3:24 
GeneralRe: Accessing Form Elements From Different Files Pin
Gerry Schmitz4-Dec-12 10:35
mveGerry Schmitz4-Dec-12 10:35 
QuestionPassing object between event handlers? Pin
Member 96474613-Dec-12 13:30
Member 96474613-Dec-12 13:30 
AnswerRe: Passing object between event handlers? Pin
SledgeHammer013-Dec-12 13:52
SledgeHammer013-Dec-12 13:52 
GeneralRe: Passing object between event handlers? Pin
Member 96474614-Dec-12 6:33
Member 96474614-Dec-12 6:33 
GeneralRe: Passing object between event handlers? Pin
SledgeHammer014-Dec-12 6:39
SledgeHammer014-Dec-12 6:39 
GeneralRe: Passing object between event handlers? Pin
Member 96474614-Dec-12 7:37
Member 96474614-Dec-12 7:37 
GeneralRe: Passing object between event handlers? Pin
SledgeHammer014-Dec-12 8:10
SledgeHammer014-Dec-12 8:10 
Questionusing c\c++ dll from winrt (c++) Pin
bondarenkod3-Dec-12 11:15
bondarenkod3-Dec-12 11:15 
AnswerRe: using c\c++ dll from winrt (c++) Pin
Dave Kreskowiak3-Dec-12 12:29
mveDave Kreskowiak3-Dec-12 12:29 
Question256 points at 250 Hz Pin
C-P-User-33-Dec-12 10:50
C-P-User-33-Dec-12 10:50 
AnswerRe: 256 points at 250 Hz Pin
SledgeHammer013-Dec-12 11:50
SledgeHammer013-Dec-12 11:50 
GeneralRe: 256 points at 250 Hz Pin
C-P-User-33-Dec-12 13:20
C-P-User-33-Dec-12 13:20 
GeneralRe: 256 points at 250 Hz Pin
SledgeHammer013-Dec-12 13:50
SledgeHammer013-Dec-12 13:50 

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.