Click here to Skip to main content
15,907,677 members
Home / Discussions / C#
   

C#

 
QuestionPop up menu in combobox Pin
AnnnS19-Jul-06 19:58
AnnnS19-Jul-06 19:58 
AnswerRe: Pop up menu in combobox Pin
Paul Conrad19-Jul-06 20:02
professionalPaul Conrad19-Jul-06 20:02 
GeneralRe: Pop up menu in combobox Pin
AnnnS19-Jul-06 20:10
AnnnS19-Jul-06 20:10 
GeneralRe: Pop up menu in combobox Pin
Paul Conrad19-Jul-06 20:31
professionalPaul Conrad19-Jul-06 20:31 
GeneralRe: Pop up menu in combobox Pin
Rahul.RK19-Jul-06 20:35
Rahul.RK19-Jul-06 20:35 
GeneralRe: Pop up menu in combobox Pin
Paul Conrad19-Jul-06 20:43
professionalPaul Conrad19-Jul-06 20:43 
GeneralRe: Pop up menu in combobox Pin
AnnnS19-Jul-06 20:50
AnnnS19-Jul-06 20:50 
GeneralRe: Pop up menu in combobox Pin
Paul Conrad19-Jul-06 20:52
professionalPaul Conrad19-Jul-06 20:52 
QuestionVScrollbar within a Panel Pin
John Harrison Paul19-Jul-06 18:21
John Harrison Paul19-Jul-06 18:21 
QuestionCheck to see if table exists Pin
Saamir19-Jul-06 16:07
Saamir19-Jul-06 16:07 
AnswerRe: Check to see if table exists Pin
Stathread19-Jul-06 18:13
Stathread19-Jul-06 18:13 
QuestionRe: Check to see if table exists Pin
Saamir20-Jul-06 2:58
Saamir20-Jul-06 2:58 
AnswerRe: Check to see if table exists Pin
Stathread20-Jul-06 16:03
Stathread20-Jul-06 16:03 
GeneralRe: Check to see if table exists Pin
Stathread20-Jul-06 16:07
Stathread20-Jul-06 16:07 
QuestionRestoring control's default properties Pin
xkx3219-Jul-06 15:58
xkx3219-Jul-06 15:58 
AnswerRe: Restoring control's default properties Pin
Super Lloyd19-Jul-06 17:15
Super Lloyd19-Jul-06 17:15 
QuestionGetting HTML source displaying [modified] Pin
James Dufty19-Jul-06 15:38
James Dufty19-Jul-06 15:38 
AnswerRe: Getting HTML source displaying Pin
Stefan Troschuetz19-Jul-06 21:30
Stefan Troschuetz19-Jul-06 21:30 
AnswerRe: Getting HTML source displaying [modified] Pin
Gavin Roberts20-Jul-06 0:23
Gavin Roberts20-Jul-06 0:23 
GeneralRe: Getting HTML source displaying Pin
James Dufty20-Jul-06 15:35
James Dufty20-Jul-06 15:35 
Questionpassing data to a textbox on a form using a method in a class Pin
haz1319-Jul-06 13:32
haz1319-Jul-06 13:32 
AnswerROTFLMAO Pin
Ennis Ray Lynch, Jr.19-Jul-06 13:57
Ennis Ray Lynch, Jr.19-Jul-06 13:57 
QuestionRe: ROTFLMAO Pin
haz1319-Jul-06 14:28
haz1319-Jul-06 14:28 
AnswerRe: ROTFLMAO Pin
Ennis Ray Lynch, Jr.19-Jul-06 14:40
Ennis Ray Lynch, Jr.19-Jul-06 14:40 
AnswerRe: passing data to a textbox on a form using a method in a class Pin
Christian Graus19-Jul-06 19:16
protectorChristian Graus19-Jul-06 19:16 
Trying for a more helpful version of the comment you got...


haz13 wrote:
Form1.textBox1.text = "hello";


Form1 is a class. You need to access an instance of the class to pass a value through. What you're trying to do is a VB6 hack.

The best way to do this is to create a delegate between the two classes. I assume delegates can be static, although I've never seen one. If not, you will need an instance of NumberProcessing inside Form1.

The other way to do it is to create a property on Form1 which sets the text of textbox1, and pass a reference to the Form1 instance that's in use to NumberProcessing. This is less of a hack than what you're doing, but not as nice as the delegate.

I trust the code you're showing is just pseudo code. There is no level on which textbox1 and form1 are acceptable variable names. Also, if your controls are public, change them to protected at least. That's just another poor design that you'll come to regret later.



Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog

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.