VB5 to Pic VB5 Help


Closed Thread
Results 1 to 21 of 21

Hybrid View

  1. #1
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    704


    Did you find this post helpful? Yes | No

    Default

    I use VB6, but I am not familiar with VB5. However, they should be more or less the same.

    Try a Label box instead of a Text box. The following code works fine for me, because I just took it from one of my working VB6 programs.

    Code:
    Label1.Caption = byte1 & vbcrlf & byte2 & vbcrlf & byte3
    If you still insist in using a Text box, then the following might help you. This quote is taken from a VB6 help file.

    To display multiple lines of text in a TextBox control, set the MultiLine property to True. If a multiple-line TextBox doesn't have a horizontal scroll bar, text wraps automatically even when the TextBox is resized. To customize the scroll bar combination on a TextBox, set the ScrollBars property.

    Scroll bars will always appear on the TextBox when its MultiLine property is set to True, and its ScrollBars property is set to anything except None (0).

    If you set the MultiLine property to True, you can use the Alignment property to set the alignment of text within the TextBox. The text is left-justified by default. If the MultiLine property is False, setting the Alignment property has no effect.
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  2. #2
    Join Date
    Aug 2009
    Location
    Paso Robles California
    Posts
    167


    Did you find this post helpful? Yes | No

    Default Pic to VB5

    Ok some of this worked and some did not I will be working on this again next week.
    I have not given up just had problems (KIDS) thanks and will post more next week

  3. #3
    Join Date
    Aug 2009
    Location
    Paso Robles California
    Posts
    167


    Did you find this post helpful? Yes | No

    Default vb5 to Pic

    Quote Originally Posted by rsocor01 View Post
    I use VB6, but I am not familiar with VB5. However, they should be more or less the same.

    Try a Label box instead of a Text box. The following code works fine for me, because I just took it from one of my working VB6 programs.

    Code:
    Label1.Caption = byte1 & vbcrlf & byte2 & vbcrlf & byte3
    If you still insist in using a Text box, then the following might help you. This quote is taken from a VB6 help file.
    I tried your example and it worked but try this and let me know if it works for you


    label1.Caption = byte1 & byte2 & byte3 & vbcrlf

    now go through this 5 times and see if it goes to the next line or stays on one line

  4. #4
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    704


    Did you find this post helpful? Yes | No

    Default

    It stays on one line. Remember you are changing the caption of the label object.

    Robert
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  5. #5
    Join Date
    Aug 2009
    Location
    Paso Robles California
    Posts
    167


    Did you find this post helpful? Yes | No

    Default vb5 to pic

    Quote Originally Posted by rsocor01 View Post
    It stays on one line. Remember you are changing the caption of the label object.

    Robert

    Robert No I don't understand what your saying changing the caption Im lost
    I want byte1 byte2 and byte3 on one line, then the next line down the same thing this is serial data so byte1-3 are different values on each line, there just being used for formatting a string value so the layout is simple and easy.

  6. #6
    Join Date
    Jan 2009
    Location
    Miami, Florida USA
    Posts
    704


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by l_gaminde View Post
    Robert No I don't understand what your saying changing the caption Im lost
    I want byte1 byte2 and byte3 on one line, then the next line down the same thing this is serial data so byte1-3 are different values on each line, there just being used for formatting a string value so the layout is simple and easy.
    l_gaminde,

    For a Label, do the following,

    Set the Multiline property of the label object to true. Also, make the scrollbars visible if you want to. End your command line with & vbcrlf like in the code that you posted

    Code:
    label1.Caption = byte1 & byte2 & byte3 & vbcrlf
    For a Textbox, do the following,
    • Set Multiline to true
    • Set ReadOnly to true
    • Write your code like the following
    Code:
    textbox1.text = byte1 & byte2 & byte3 & VbCrLf             'This is the first line
    textbox1.AppendText(byte1 & byte2 & byte3 & VbCrLf)   'These are the following lines
    I'm not in front of my personal PC, so I haven't tested this code but it should work. Let me know if you have problems.

    Robert
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

  7. #7
    Join Date
    Aug 2009
    Location
    Paso Robles California
    Posts
    167


    Did you find this post helpful? Yes | No

    Default vb5

    Quote Originally Posted by rsocor01 View Post
    l_gaminde,

    For a Label, do the following,

    Set the Multiline property of the label object to true. Also, make the scrollbars visible if you want to. End your command line with & vbcrlf like in the code that you posted

    Code:
    label1.Caption = byte1 & byte2 & byte3 & vbcrlf
    For a Textbox, do the following,
    • Set Multiline to true
    • Set ReadOnly to true
    • Write your code like the following
    Code:
    textbox1.text = byte1 & byte2 & byte3 & VbCrLf             'This is the first line
    textbox1.AppendText(byte1 & byte2 & byte3 & VbCrLf)   'These are the following lines
    I'm not in front of my personal PC, so I haven't tested this code but it should work. Let me know if you have problems.

    Robert
    ok the first one doesn't work, thats what I have been wondering about it sits on line one and changes per each set of inputs and never drops down vbcrlf chr(10) or 13 nothing works on the end of the line ?? works in the middle like your test but not at the end.
    I will try the append thing now it will not read the first line textbox1.text again because I may have 30 to 100 or more lines to download

  8. #8
    Join Date
    Aug 2009
    Location
    Paso Robles California
    Posts
    167


    Did you find this post helpful? Yes | No

    Default vb5

    Quote Originally Posted by rsocor01 View Post
    l_gaminde,

    For a Label, do the following,

    Set the Multiline property of the label object to true. Also, make the scrollbars visible if you want to. End your command line with & vbcrlf like in the code that you posted

    Code:
    label1.Caption = byte1 & byte2 & byte3 & vbcrlf
    For a Textbox, do the following,
    • Set Multiline to true
    • Set ReadOnly to true
    • Write your code like the following
    Code:
    textbox1.text = byte1 & byte2 & byte3 & VbCrLf             'This is the first line
    textbox1.AppendText(byte1 & byte2 & byte3 & VbCrLf)   'These are the following lines
    I'm not in front of my personal PC, so I haven't tested this code but it should work. Let me know if you have problems.

    Robert
    Ok i tried the second part and it will not compile method or data member not found
    and thats the Appendtext

  9. #9
    Join Date
    Aug 2009
    Location
    Paso Robles California
    Posts
    167


    Did you find this post helpful? Yes | No

    Default vb5

    Quote Originally Posted by rsocor01 View Post
    l_gaminde,

    For a Label, do the following,

    Set the Multiline property of the label object to true. Also, make the scrollbars visible if you want to. End your command line with & vbcrlf like in the code that you posted

    Code:
    label1.Caption = byte1 & byte2 & byte3 & vbcrlf
    For a Textbox, do the following,
    • Set Multiline to true
    • Set ReadOnly to true
    • Write your code like the following
    Code:
    textbox1.text = byte1 & byte2 & byte3 & VbCrLf             'This is the first line
    textbox1.AppendText(byte1 & byte2 & byte3 & VbCrLf)   'These are the following lines
    I'm not in front of my personal PC, so I haven't tested this code but it should work. Let me know if you have problems.

    Robert
    one more thing I have changed the byte1 -3 and its now mystr which is all formatted

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

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