Job Recruitment Website - Zhaopincom - How to realize text box wrapping in VB
How to realize text box wrapping in VB
1.-
Set the MultiLine property of Text4 to True.
Copy the following code:
Private? Sub? Form_Load()
Text 4. Words? =? ""
End? submarine
Private? Sub? Command 1_Click()
Text 4. Words? =? Text 4. Words? +? Text 1。 Words? +? Text 2. Words? +? SMS 3. Words? +? vbCrLf
End? submarine
The following is to ensure that the focus of Text4 is at the end. Try to remove the following three lines and observe the effect. You will find that these three lines are also important.
Private? Sub? Text4_Change()
Text 4. SelStart? =? Len(Text4。 Text)?
End? submarine
2.-
If you use a list, you can also double-click to copy the contents of the following list items.
Private? Sub? List 1_DblClick()
Clipboard. clear
Clipboard. SetText? List 1。 List (List 1. List index)
MsgBox? This item has been copied to the clipboard. Please paste it with CTRL+V.
End? submarine
3.-
Richtextbox is easier to use than textbox. For example, richtextbox can display different fonts and pictures per line, but its complicated usage is not needed here.
Click on "Engineering" and "Parts" to find "Microsoft? Rich? Text box? Contrast? 6.0 ",click OK, and then you can see it in the tool. Draw RichTextBox 1 on the form?
RichTextBox 1? You don't need to set MultiLine, and the code is written in the same way as Text4.
Copy the following code:
Private? Sub? Form_Load()
RichTextBox 1? =? ""
End? submarine
Private? Sub? Command 1_Click()
RichTextBox 1。 Words? =? RichTextBox 1。 Words? +? Text 1。 Words? +? Text 2. Words? +? SMS 3. Words? +? vbCrLf
End? submarine
Private? Sub? RichTextBox 1_Change()
RichTextBox 1。 SelStart? =? Len(RichTextBox 1。 Text)? Make sure the focus of RichTextBox 1 is at the end.
End? submarine
I have tested the above code, which can be used directly! ! ? Look at the picture!
- Previous article:Xiaojiang, this is Nanchang, Jiangxi. How to book a trip to Sichuan?
- Next article:How to evaluate interview experience
- Related articles
- Speech on competitive credit
- Infrastructure of Zhoucun Economic Development Zone
- Is the work of Jimpia Workshop in Huangdao simple?
- Guangzhou printing plant recruitment pulp room
- Employment prospect of remote sensing science and technology
- How to take a bus from Ningbo Railway Station to shenjiamen?
- Where can I buy Xiaomi max mobile phone in Sihong County?
- Why do women make the same mistake? Women are worse than men.
- How about Nanjing Migu Culture Media Co., Ltd.?
- What is the treatment like for BAIC Molding undergraduate students? Do you work overtime on weekends?