display static text in vb.net
hi,
I've some informations in a word document (2,3 pages). I want to show this to the user from vb.net form. How can I do this?
Can I use Labels? :confused: But it is not look nice (the alignments are not good) and take much time to paste line by line. I'm sure there is better way to do this :bigyello: ;) Need quick response...Thanks
Re: display static text in vb.net
Re: display static text in vb.net
Hi,
Thanks for immediate response.
I want only show the text..with richtextbox user can edit the text, right? :confused:
Re: display static text in vb.net
Set the ReadOnly property to true for the RTB.
Re: display static text in vb.net
But then why can't i use Labels inseted of RTB...what is the difference between those two. if I make readonly-true, borderstyle-None and backcolor-control..then RTB looks like Label!!! Sorry..i hope i'm not irretating anybody by this silly questions...Just want to know about .net clearly. :)
Re: display static text in vb.net
make sure you set the rtb to multiline... Labels are only for a few words at the most. They are as their name suggest, to label things. You need an RTB or even a regular textbox would be ok.
Re: display static text in vb.net
Is RTB is the only way to show the text to the user. I have more than 2 pages of text in word document. I did the following coding to put the word document text in to RTB.
VB Code:
RichTextBox1.Text = "This is the first line" _
& vbCrLf _
& "This is the second line" _
& vbCrLf _
& "This is the third line" _
& vbCrLf _
& "This is the fourth line" _
& vbCrLf _
& "This is the fifth line"
Am i doing correctly? :confused: :afrog:
Re: display static text in vb.net
You could also just save the word document as a .rtf and then load the document a runtime
VB Code:
RichTextBox1.Load("C:\My Path\My File.rtf")
Re: display static text in vb.net
Quote:
Originally Posted by <ABX
You could also just save the word document as a .rtf and then load the document a runtime
VB Code:
RichTextBox1.Load("C:\My Path\My File.rtf")
Thanks...it helps me to show the text...
but the syntax is...
VB Code:
RichTextBox1.LoadFile("C:\My Path\My File.rtf")
Big thanks to everybody :wave:
Re: display static text in vb.net
Quote:
Originally Posted by haihems
Thanks...it helps me to show the text...
but the syntax is...
VB Code:
RichTextBox1.LoadFile("C:\My Path\My File.rtf")
Big thanks to everybody :wave:
Argh.. My memorys letting up on me :(