943,735 Members | Top Members by Rank

Ad:
Dec 6th, 2008
0

adding textbox to rtb

Expand Post »
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?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
yuleball is offline Offline
14 posts
since Dec 2008
Dec 6th, 2008
0

Re: adding textbox 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.
Reputation Points: 13
Solved Threads: 29
Junior Poster
kb.net is offline Offline
169 posts
since Aug 2007
Dec 11th, 2008
0

Re: adding textbox to rtb

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?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
yuleball is offline Offline
14 posts
since Dec 2008
Dec 12th, 2008
0

Re: adding textbox to rtb

Hi,

Try This Code :

vb Syntax (Toggle Plain Text)
  1. Dim MyStr As String
  2. Dim TotRTF As String
  3. Dim MyText As String
  4. '
  5. MyText = "MYTEXTBOX"
  6. MyStr = "\par \trowd\trgaph108\trleft36\cellx1636\pard\intbl "
  7. MyStr = MyStr & MyText & "\cell\row\pard\par"
  8. With RTB
  9. .SelText = Chr(&H80)
  10. TotRTF = .TextRTF
  11. TotRTF = Replace(.TextRTF, "\'80", MyStr)
  12. .TextRTF = TotRTF
  13. End With

Regards
Veena
Reputation Points: 84
Solved Threads: 140
Posting Shark
QVeen72 is offline Offline
923 posts
since Nov 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Match String and extract till EndOfLine
Next Thread in Visual Basic 4 / 5 / 6 Forum Timeline: Get Data Help





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC