Output components in C#.NET
-
mardi 2 mai 2006 03:08Hi, i am new in C#.NET and I am using Visual Studio 2005. I want to use a graphic component that show the output from an arithmetic operation with variables that I have created. Please, anybody tell me this.
Toutes les réponses
-
mardi 2 mai 2006 03:20Modérateur
How do you mean, a graphical component ? How do you want to 'graphically' represent the result of 8*2 ? If you want to draw something like a chart, or a line of coconuts, or anything except text, then you need to do it to a Bitmap, and then display that. You'd create a control and it would intercept the Paint event, and draw whatever you wanted to draw there.
If, on the other hand, you just want to output a number, I don't see why you'd want to create a control to do that. Label works just fine. You just need to set the text.
-
mardi 2 mai 2006 03:31Can I do that with a text box? Text box is only for input or it can wotk with outputs too?
-
mardi 2 mai 2006 03:36Modérateur
A textbox displays text, but it can be changed by the user. You can use the Text property to set the text of a textbox, but unless you want the user to be able to change it, you should use a Label.

