Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: VB question  (Read 2859 times)

0 Members and 1 Guest are viewing this topic.

Useless

  • Guest
VB question
« on: November 20, 2007, 11:48:41 AM »
Im new to VB (started learning it at college about 2 months ago)

now in my spare time, im creating a little word processor.

Ive ran into a really noobish problem as i dont know how to do this:

when you click a tool strip button, it inserts it into a rich text box

Say, i want to insert a
Code: [Select]
<hr> into the rich textbox

How do i do it ?

Thanks in advance

Sidewinder



    Guru

    Thanked: 139
  • Experience: Familiar
  • OS: Windows 10
Re: VB question
« Reply #1 on: November 20, 2007, 03:22:55 PM »
Code: [Select]
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e _
As System.EventArgs) Handles ToolStripButton1.Click
    RichTextBox1.Text = "<hr>"
End Sub

Set the Text property for the RichTextBox in the click event for the toolstrip button.

The above example is VB.Net. If your using VB6, it's the same method, double click the toolstrip button in design mode and set the RichTextBox text property to ""

 8)
The true sign of intelligence is not knowledge but imagination.

-- Albert Einstein