Originally Posted By: Paul
by the way you can also declare a value to the text
inside a textbox and disable the textbox at design time
this way the text inside the textbox is unchangeable but the value of the text inside the textbox has value is visible to the user and can be called at runtime
as in x = val(textbox1.text)

If I wanted to do something like that I wouldn't use a text box. When you disable a text box the text is grayed out. It is still readable, but it really looks odd. I would use a label. A label displays the text in the normal mode, but can't be edited by the user, so that makes it work just the same for your application, without being grayed out.

The fact is that I use labels quite a bit for displaying the results of calculations. You can change the text displayed in a label programmatically.
e. g. lblTprime.text = val(txtT.text) * sqrt(1 - val(txtV.text)^2/val(lblC.text)^2)

I do try give my text boxes and labels meaningful names. Starting them with lbl or txt gives me a quick clue as to what I am operating on and clarifies the operations I can perform on it.

This also assumes you are using Visual Basic, other languages use different conventions, but what you have been saying sounds to me like VB.

Of course I don't know what you are developing so I don't know why you would want your constant shown on the screen.

Bill Gill


C is not the speed of light in a vacuum.
C is the universal speed limit.