CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Guest

    aligning text + more

    how do I align text within a textbox during run time? To the left, center, and right....with only selected text (.seltext)?
    Also, how can I change the font to bold, italic, strikethru, and underline, by toggling? I tried this:


    text1.fontbold = not fontbold




    but it turns the font to bold, but doesn't make it not bold... How can I make it so that selected text will become bold, underline, strikethru, italic, and if there is no selected text, any text typed after that is that kind?



  2. #2
    Join Date
    Dec 1999
    Location
    Texas
    Posts
    96

    Re: aligning text + more

    You need to use a Rich-TextBox (RICHTXT32.OCX). The Rich-TextBox has properties and methods for formatting,aligning,printing,saving,etc. (e.g. RichTextBox1.SelColor = vbRed). A standard VB TextBox will not support formatting of individual segments of text.


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

Featured