Results 1 to 11 of 11

Thread: Formattable Textbox

  1. #1

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    Brisbane, Australia
    Posts
    34

    Formattable Textbox

    Hi All,

    I need to create a textbox control that can have other objects embedded into it (Ie. Images). These objects need to be inserted into the flow of text. I can't see how to do it with a control inherited from a text box control. I also need to do text formatting, bulleting, TABS, numbering and paragraph styles.

    Is it possible to inherit from TextBoxBase?

    Thanks in advance.

    Alan Liddle

  2. #2
    Member
    Join Date
    Sep 2002
    Location
    California
    Posts
    52
    A TextBox can't contain other Objects. Panels are the only Objects that can contain other Objects. Well, I suppose I could be wrong but at least that's how I understand it.

    The only way I can think of this is to use a Panel. You'll have to actually draw the text using e.Graphics.DrawString in the Panels Paint event though.

  3. #3
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    That is a slite understatement..... Forms, Groupboxes, Toolbars and some other objects can contain other objects. There is also a possability to implement the IContainer interface for a Home-made control to create container features.

  4. #4
    Member
    Join Date
    Sep 2002
    Location
    California
    Posts
    52
    Hmm. Yeah. It's late, I just don't know what I type sometimes..

  5. #5
    Registered User
    Join Date
    Nov 2002
    Location
    Växjö, Sweden
    Posts
    314
    Hehe, I know the feeling..... It's morning here and I just had my morning coffee, so I'm still alert....

  6. #6
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Also a richtextbox can hold images and things of that nature.

  7. #7
    Member
    Join Date
    Sep 2002
    Location
    California
    Posts
    52
    No kiddin? I didn't know that, LOL.

  8. #8

    Thread Starter
    Member
    Join Date
    Aug 2002
    Location
    Brisbane, Australia
    Posts
    34
    Can a RichTextBox really contain images? Can they contain other objects?

    Alan

  9. #9
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Yes. RTF is pretty much the same format that WORD uses. Although I'm not sure how you do tables. Images are no problem, you can use the RichTextBox's Paste method.

    Yup I just tested tables too. Although I'm not sure the RTF code to make one, but you can copy one in so they can contain it.

  10. #10
    Hyperactive Member RealNickyDude's Avatar
    Join Date
    Nov 2002
    Location
    Watching you through the hidden camera :o
    Posts
    435
    Is it possible, when writing in a richtextbox, to be able to select an image using a filedialog and have it inserted into the text where the cursor is without cutting and pasting? (a sort of insert clipart)
    [vbcode]
    On Error GoTo Hell
    [/vbcode]:¬) Nicky : Why not try VBCodebook.NET.

  11. #11
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Probably not, but you do the cutting and pasting in the code so the user doesn't see or do that part. You can also reset the clipboard with what it had before so they don't lose their own things they had in there.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width