1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

VB.NET ~ Adding text to richtextbox and textbox value?

Discussion in 'Visual Basic .NET' started by simpleonline1234, Sep 15, 2011.

  1. simpleonline1234

    simpleonline1234 Junior Member

    Joined:
    Jan 26, 2010
    Messages:
    169
    Likes Received:
    13
    I have a richtextbox and I am adding text to the rich text box programmically using:

    Code:
    RichTextBox1.AppendText(Environment.NewLine & "The red fox jumps over the"
    I have a variable called "myvariable"
    How can I program my button to type the text above and then insert variable's value in one line?

    Example:
    Let's that myvariable = "moon"


    How can I code my button to say:
    "The red fox jumps over the moon"

    Thanks
     
    Last edited: Sep 15, 2011
  2. andee

    andee Regular Member

    Joined:
    Jul 24, 2010
    Messages:
    218
    Likes Received:
    83
    maybee im missing something but couldnt you just,

    A) richtextbox1.text = ("the red fox jumps over the " & myvariable)

    B) richtextbox1.text += myvariable & vbclrf
     
  3. Hydrogen

    Hydrogen Newbie

    Joined:
    Dec 30, 2009
    Messages:
    39
    Likes Received:
    23
    Occupation:
    Co-Owner of AdvertMarketing
    Home Page:
    Yes you are right Andee, and OP this is just a continuation of your other thread which I gave you that code snippet for, why create a entirely new thread and not just ask the question in your original thread?

    Not trying to be a dick or anything but, the questions you are asking are very basic in nature and usually within the first few chapters of a vb.net tutorial website. It seems to me as you are trying to learn to program through this thread one component/method at a time. My honest suggestion is take some time, use google and the resources it provides a simple VB.Net +"WHATEVER YOU ARE LOOKING FOR" + tutorial will usually yield you the exact thing you are looking for in roughly .05 seconds.
     
    Last edited: Sep 18, 2011