By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,649 Members | 1,560 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,649 IT Pros & Developers. It's quick & easy.

How can I display info text in my dialoge form?

P: n/a
I want to display some informational text in a dialog something along
the lines of 'enter your text in the below box and press OK to save, or
Cancel to exit'.

I'm using a textbox to display this is that the right way to do it? The
user doesn't enter text into this, it's just informational so I wasn't
sure if textbox was best?

Problem with the textbox is when the form loads (a) it's highlighted in
blue, and (b) the user can click and get a cursor inside it. I've found
the readonly property but this doesn't stop the cursor from being able
to appear inside the text...

If textbox is the right control to use for this, how do i stop people
from being able to click into the text?

Thanks,

Gary.

Mar 27 '06 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hi Gary,

If the text is just for information, and the button choices are limited
to OK and Cancel, why don't you use an InputBox ?

string Result = "";
Result = InputBox("Enter your text in the below box and press OK to
save, or Cancel to exit", "Text Entry", "")
if (Result != "")
{
// Do something with the entered text
}

Mar 27 '06 #2

P: n/a
I tried your solution but it didn't work and generated an error... I
had a look on the internet and apparently there's no inputBox in dot
net =/

Mar 27 '06 #3

P: n/a
I had a look on the internet and apparently there's no inputBox in dot
net =/
This is not strictly true, there is an InputBox function in VB.net, but not
c#

Regards
Scott Blood
C# Developer

<ga********@myway.com> wrote in message
news:11*********************@t31g2000cwb.googlegro ups.com...I tried your solution but it didn't work and generated an error... I
had a look on the internet and apparently there's no inputBox in dot
net =/

Mar 27 '06 #4

P: n/a
For purely informational text, use a label.

Mar 27 '06 #5

P: n/a
Thanks I tried this first but how do i make a label multi line?

Mar 28 '06 #6

P: n/a
Add your text, placing \r\n where you need line breaks. You can also
set AutoSize to false if you want to size the lable manually

Mar 28 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.