Page 1 of 2 12 LastLast
Results 1 to 10 of 15
  1. #1
    draac Guest

    Visual Basic question

    i would ask this question over in the vb forum but its not active.


    im making a text editor like a page builder and i cant seam to make the codes drop down a line
    they go across
    so i assume i need a line break code.

    im new so this is what i have in a command button
    and im not sure were or how to add a line break

    Private Sub Command1_Click()
    '
    Text1.SelText = "[TEXT code HERE]"
    End Sub

    my second questions is ssTab
    i have 3 command buttons
    but the ssTab dont seam to place the command buttons to that tab and hide the command button when selecting the ssTab
    the command buttons allway stay out front

  2. #2
    Join Date
    May 2002
    Location
    Essex, UK.
    Posts
    16,958

    Re: Visual Basic question

    Originally posted by draac
    i would ask this question over in the vb forum but its not active.
    and all the time people post in the lounge it never will be, its a viscious circle.... moved.

  3. #3
    Join Date
    Sep 2004
    Location
    The Netherlands
    Posts
    1,027
    There are VB forums in the programming section. I think should ask it overthere. Or a mod will move it to the VB forum.

    Edit: I see that last thing already happened.

  4. #4
    Join Date
    May 2003
    Location
    Van Nuys California
    Posts
    3,579
    There is only one simple text OCX in VB. You use it for single line input. You use it for multi-line input. It has three properties that you need to set:

    (1) Multi-line = True
    (2) Accepts returns = True
    (3) Accepts Tabs = true

    When you go multi-line, the OCX stores its data in an array of strings called strings[]. Each string in the array is identical to 1 line in the text control. You terminate each line with a vbCRLF. This is the VB constant for a Cariage return and line feed. These are ASCII codes 10 and 13.

    I think there is a glitch in the latest version which forces you to store the strings[] array to a file and reload it from disk before you get the properly formatted look. Everything just runs together in an endless line until you do that.

  5. #5
    draac Guest
    Originally posted by davidaleon
    There is only one simple text OCX in VB. You use it for single line input. You use it for multi-line input. It has three properties that you need to set:

    (1) Multi-line = True
    (2) Accepts returns = True
    (3) Accepts Tabs = true

    When you go multi-line, the OCX stores its data in an array of strings called strings[]. Each string in the array is identical to 1 line in the text control. You terminate each line with a vbCRLF. This is the VB constant for a Cariage return and line feed. These are ASCII codes 10 and 13.

    I think there is a glitch in the latest version which forces you to store the strings[] array to a file and reload it from disk before you get the properly formatted look. Everything just runs together in an endless line until you do that.
    im new and i really didnt undestand a word you said.
    can you c/c/p a code how i am supose to do it
    or be more clear on walking me threw it.

  6. #6
    Join Date
    May 2003
    Location
    Van Nuys California
    Posts
    3,579
    It's more a matter of setting properties on the visual property sheet. I suppose you can set the properties with code at run time [as you can most any property] but it is much easier to do it in the visual property sheet.

    Just select the text control and have a look at the sheet and all three properties will be there.

  7. #7
    draac Guest
    im still not following you.
    i probley cant use property sheets because i have all ready made a hole bunch of command buttons which took me 3 hours and i dont want to re do it.
    when i click the command button it incerts a text with a tag
    but the problem is, the text keeps moving to the right
    instead of droping down a line like this
    code1
    code2
    code3
    code4
    but all i get is
    code1code2code3code4
    unless i place by curser below then it drops down a line
    but i dont want that.

    is this the property sheet your talking about?

    Last edited by draac; 03-02-2005 at 03:59 PM.

  8. #8
    Join Date
    May 2003
    Location
    Van Nuys California
    Posts
    3,579
    Okay three points:

    (1) Each command button that inserts a code will have to append the vbCRLF constant to the end of the string. This is the carriage return +line feed constant. Without this constant terminating each string line, the text control will not wrap the text which follows down to the next line. Even if you have already written a bunch of code, I can't change the reality of that statement.

    (2) The text control itself must be configured to display multiple lines. Otherwise it will not display multiple lines. You configure a text control to diplay multiple lines by setting the three properties I mentioned above on the text control itself. If the three text control properties are not set the way I mentioned, you will not be able to display a formatted ASCII file in the textbox control.

    (3) Even if you configure the text control, and terminate each line with a vbCRLF, you may still have a problem. As I mentioned before, I'm pretty sure the latest rev of the text box has a bug which forces you to dump the text and reload it from a file before things are formated correctly.

    <edit>
    It looks like you aren't anywhere near the latest rev, so don't sweat the last point.
    </edit>

  9. #9
    draac Guest
    i kind of understand you but not a hole bunch
    so ill move on with my other question above about the ssTab
    i have a bunch of command buttons and i need to organize my command buttons using the ssTab.

    problem is, i have 3 tabs on the ssTab but the command buttons dont fold up in the tab when i select the tab
    the command buttons allways stay on the front and i can see them all the time.

    please give me a short sample and remember im a newbie so please dont go over my head or it wont do me any good.

  10. #10
    draac Guest
    i did get both problems solved and i apprecate your help.
    this worked great

    Text1.SelText = vbNewLine & "[Code,here]"

Page 1 of 2 12 LastLast

Posting Permissions

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