Click here to Skip to main content
15,916,600 members
Home / Discussions / C#
   

C#

 
QuestionAccess controls from different class Pin
soulidentities17-May-09 18:27
soulidentities17-May-09 18:27 
AnswerRe: Access controls from different class Pin
Ravi Bhavnani17-May-09 18:47
professionalRavi Bhavnani17-May-09 18:47 
GeneralRe: Access controls from different class Pin
soulidentities17-May-09 20:16
soulidentities17-May-09 20:16 
GeneralRe: Access controls from different class Pin
Ravi Bhavnani17-May-09 20:35
professionalRavi Bhavnani17-May-09 20:35 
GeneralRe: Access controls from different class Pin
soulidentities17-May-09 21:13
soulidentities17-May-09 21:13 
GeneralRe: Access controls from different class Pin
Ravi Bhavnani17-May-09 21:18
professionalRavi Bhavnani17-May-09 21:18 
GeneralRe: Access controls from different class Pin
soulidentities17-May-09 21:30
soulidentities17-May-09 21:30 
AnswerRe: Access controls from different class Pin
DaveyM6917-May-09 22:52
professionalDaveyM6917-May-09 22:52 
Ravi has given you a solution that will work, but I don't believe it's the best or recommended way. Your Class1 should not be reliant on other objects to do it's stuff, so passing an object reference (a form, a control etc) in the constructor or elsewhere is not a good idea.

If the controls on Form1 need to be manipulated, it should be done from Form1 and nowhere else. If it needs to be in response to activity in Class1, then Class1 should raise relevant events and Form1 should subscribe to those and update the controls, play a fanfare or whatever.

Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
Why are you using VB6? Do you hate yourself? (Christian Graus)

GeneralRe: Access controls from different class Pin
soulidentities18-May-09 0:01
soulidentities18-May-09 0:01 
GeneralRe: Access controls from different class Pin
DaveyM6918-May-09 1:19
professionalDaveyM6918-May-09 1:19 
GeneralRe: Access controls from different class Pin
soulidentities18-May-09 5:43
soulidentities18-May-09 5:43 
GeneralRe: Access controls from different class Pin
DaveyM6918-May-09 6:30
professionalDaveyM6918-May-09 6:30 
Question.NET Framework Version Pin
Blue36517-May-09 15:06
Blue36517-May-09 15:06 
AnswerRe: .NET Framework Version Pin
PIEBALDconsult17-May-09 16:14
mvePIEBALDconsult17-May-09 16:14 
GeneralRe: .NET Framework Version Pin
adatapost17-May-09 17:20
adatapost17-May-09 17:20 
GeneralRe: .NET Framework Version Pin
PIEBALDconsult17-May-09 18:00
mvePIEBALDconsult17-May-09 18:00 
AnswerRe: .NET Framework Version Pin
adatapost17-May-09 20:59
adatapost17-May-09 20:59 
AnswerRe: .NET Framework Version Pin
DaveyM6917-May-09 22:58
professionalDaveyM6917-May-09 22:58 
GeneralRe: .NET Framework Version Pin
Blue36517-May-09 23:25
Blue36517-May-09 23:25 
GeneralRe: .NET Framework Version Pin
PIEBALDconsult18-May-09 4:09
mvePIEBALDconsult18-May-09 4:09 
Generalget complex type from nusoap Pin
jahc17-May-09 14:36
jahc17-May-09 14:36 
Questioneasy wait(delay) like an "watabletimer & waitforsingleobjectex" Pin
Bernard3817-May-09 13:27
Bernard3817-May-09 13:27 
AnswerRe: easy wait(delay) like an "watabletimer & waitforsingleobjectex" Pin
Luc Pattyn17-May-09 16:11
sitebuilderLuc Pattyn17-May-09 16:11 
QuestionResizable control at runtime. Pin
stardust161117-May-09 9:58
stardust161117-May-09 9:58 
QuestionUsing Exponentiation Operator ^ on Deciaml Pin
GregoryWB17-May-09 9:41
GregoryWB17-May-09 9:41 

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.