I have a string with dots and carriage returns etc... totally its a big string!
I want to show it in a windows form, so i wanted to know which one will be the good control to show it upon.
Thanks in advance,
Ravi Naik.
Use a TextBox with the Multiline property set to True.
Alternatively you can use a RichTextBox control or a WebBrowser control where you set the DocumentText property.
I would probably use a RichTextBox for displaying the plain text. Check out the AppendText method.
Related
Is it possible to change the forecolor of substring in element text in GridControls's Tileview in devexpress winforms?
What's going to happen is I have a textbox and tileview
In event while textbox textchanged fire, the text matched in tileview's element text will be highlighted
The initial color of tileview's text will be blue and if its match with textbox's text it will be highlighted as gray.
See picture to check the illustration:
Is it possible? or will i need another component to attain this output?
As far I can see there is property group called Appearance (TileView.Appearance) and there you have property called ForeColor. Moreover, you can acces via code by calling
titleViewName.Appearance.ForeColor = <RGB value goes here>
Finally, there is possibility for dynamic customization via event ItemCustomize.
For further information please check official documentation and DevExpress forum. There already existis questions similiar to yours.
You can try to use HTML Text formating for displayed string:
Text = "This is some <color=red>red or <color=black><b>bold</b> text!"
Is it possible some how to make the Text of the Textbox invisible or to hide it so the user can't see it , yet it get's the input/keys from the user?
It's better to rely on the built-in capabilities.
For instance, consider to use the TextBox.PasswordChar property.
You can set ForeColor = BackColor
Paste in your Properties -> Behavior -> PasswordChar symbol you need, empty blanks works too.
is there any control like RequiredFeild control (asp.net) in windows 8 metro? I have a simple form with several text boxes and I just want to make sure to prevent submit it when a textbox is empty. I know it can be easy in code but I'm eager to know are there any alternative ways?
You might want to use WinRT XAML Toolkit:
TextBoxValidationExtensions - extensions that allow to specify the
Format of the requested Text input as well as brushes to use to
highlight a TextBox with valid or invalid Text.
I'm assuming you actually want to validate the input.
this is another solution that I found.
Here
Why you don't use String.IsNullOrEmpty() ?
I need help with it and i'm sure its simple but I cant figure it out.
In my rich text box I copy a link in and I dont want it to be a hyperlink.
So how do I remove the hyperlink?
It seems you're asking about hyperlinks in the RichTextBox in Windows Forms. If so, it's simply a matter of setting the DetectUrls property to false:
richTextBox1.DetectUrls = false;
string BadInput=Textbox.Text....
string GoodInput=BadInput.Replace("<","<").Replace(">",">");
Of course, this is assuming you don't want any HTML to be allowed in the text box.
Let's say that my textbox control is named messageTB. I would like to know if it is possible to do the following:
messageTB.Text = "Hello <b>World</b>"
and have the output text to show "Hello World". In other words is there a way to enable html markup for the control? I am using visual studio.
The standard windows forms textbox control can't do it.
If you want formatted text you need a richtextbox or some other control.
There's a browser control that you could insert (rather than a textbox or label). Here's how to set the contents...
string html = "<html><body><strong>HelloWorld!</strong></body></html>";
Browser.DocumentText = html;
No. messageTB would have to be a Literal control for this to work.
It's clumsy, but I have used two adjacent Textboxes, one with format set to bold, to do this.
At least I get the look I want on the page.