I am designing an editor program using rich text box in vb 6.0. I want to add a special box for entering verse or poems so that when I click a button, this box is placed at current position of cursor e-g if cursor is at line#3, the box is placed at line#3 and focus is changed from rtb to box. And after entering text in this box, when i click rtb, focus is changed from box to rtb, also cursor is placed below this box. Also I want that when I save the document, this box is also saved with. I have tried adding text box to accomplish these tasks but i am having problem setting position of textbox, setting focus and position of cursor. Also I dont think it can be saved with document. Is there a way to accomplish this by adding some box to rtb?

Hi,

Man i dont wana to dash your hopes, but what you r trying to do is quite difficult using such controls. I advise you to look for an alternative idea.

In Microsft word there is a way to add TextBox. I want to do the same in rtb. Is there a way to do this?

Hi,

Try This Code :

Dim MyStr As String
    Dim TotRTF As String
    Dim MyText As String
    '
    MyText = "MYTEXTBOX"
    MyStr = "\par \trowd\trgaph108\trleft36\cellx1636\pard\intbl "
    MyStr = MyStr & MyText & "\cell\row\pard\par"
    With RTB
        .SelText = Chr(&H80)
        TotRTF = .TextRTF
        TotRTF = Replace(.TextRTF, "\'80", MyStr)
        .TextRTF = TotRTF
    End With

Regards
Veena

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.