adding textbox to rtb

Reply

Join Date: Dec 2008
Posts: 14
Reputation: yuleball is an unknown quantity at this point 
Solved Threads: 0
yuleball yuleball is offline Offline
Newbie Poster

adding textbox to rtb

 
0
  #1
Dec 6th, 2008
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?
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 160
Reputation: kb.net is an unknown quantity at this point 
Solved Threads: 26
kb.net's Avatar
kb.net kb.net is offline Offline
Junior Poster

Re: adding textbox to rtb

 
0
  #2
Dec 6th, 2008
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.
It is never about the number of languages you know, you either have the logic of programming or you don't ...

Some of the codes I post are collected from different sites during the past couple of years, so I would like to thank them for their help and for enabling me to help.
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 14
Reputation: yuleball is an unknown quantity at this point 
Solved Threads: 0
yuleball yuleball is offline Offline
Newbie Poster

Re: adding textbox to rtb

 
0
  #3
Dec 11th, 2008
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?
Reply With Quote Quick reply to this message  
Join Date: Nov 2006
Posts: 848
Reputation: QVeen72 is on a distinguished road 
Solved Threads: 120
QVeen72's Avatar
QVeen72 QVeen72 is offline Offline
Practically a Posting Shark

Re: adding textbox to rtb

 
0
  #4
Dec 12th, 2008
Hi,

Try This Code :

  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
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the Visual Basic 4 / 5 / 6 Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC