VB5 to Pic VB5 Help


Closed Thread
Results 1 to 21 of 21

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default vb5

    I don't understand, I only used the first line once. I have one formatted variable mystr! Im getting this data through an oncomm when I get 9 bytes of data it fires and sets up my string sData, sData is then formatted into mystr, and mystr then sent to a file on disk and to a Picture box. I know if I have three lines it will print three lines!! I may have hundreds of lines so I really don't want to wirte 100 + text1.text lines, I want it to loop through the data as it comes in and put it on a line below the last. I have a counter running wonder if I can use the count value to tell the text box to drop one line and print can a text box be told which line to print on. This is basically a do loop where mystr is reloaded with new data each pass and then printed. Now when using the write or print commands with this data it works perfect but print and write do not work with a text box or lable box. Right now Im using to picture boxes when one fills up it goes on to the next but sometimes both fill up and I loose some data guess another picture box or two would help, bout could fill them also.




    Public Sub MSComm1_ONComm()
    If MSComm1.CommEvent = comEvReceive Then
    sData = MSComm1.Input
    cnt = cnt + 1
    cnt1 = Format(cnt, "0#")
    If Mid(sData, 1, 1) = "8" Then Command_End
    mystr = Format(sData, " 0#:## 0#/## ")
    FileNum = FreeFile ' Writes New Data To Disc (Named C:\Tracker)
    Open "C:\Tracker.txt" For Append As FileNum
    Print #FileNum, " "; cnt1 & " "; mystr
    Close FileNum
    If cnt <= 43 Then PicData1.Print " "; cnt1 & " "; mystr
    If cnt > 43 Then PicData2.Print " "; cnt1 & " "; mystr
    End If
    End Sub

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


    Did you find this post helpful? Yes | No

    Default

    Ok, I will make it even simpler. This is the code I'm using to test the multiline feature

    Code:
    Option Explicit
    
    Private Sub Command1_Click()
    Dim MyNumber As Long
    Dim I As Long
    
    MyNumber = 0
    
    For I = 0 To 50
        Text1.SelStart = Len(Text1)             'Finds the starting point to append text
        Text1.SelText = MyNumber & vbCrLf       'Appends text
        MyNumber = MyNumber + 100
    Next I
    
    End Sub
    And, this is the result

    Name:  VB6-Pic.JPG
Views: 796
Size:  18.5 KB

    Just try these two lines and they should work

    Code:
        Text1.SelStart = Len(Text1)             'Finds the starting point to append text
        Text1.SelText = MyNumber & vbCrLf       'Appends text
    Make sure you have the next settings correct

    Name:  VB6-Pic01.JPG
Views: 915
Size:  73.7 KB
    "No one is completely worthless. They can always serve as a bad example."

    Anonymous

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


    Did you find this post helpful? Yes | No

    Default VB5 to Pic

    Just try these two lines and they should work

    Text1.SelStart = Len(Text1) 'Finds the starting point to append text
    Text1.SelText = MyNumber & vbCrLf 'Appends text

    For Me Simple is really good!! THIS WORKS !! just changed the mynumber to mystr and bingo scrolls, Ok I just ( learnt somethin )

    Thank You !!
    you spent a lot of time helping! I appreciate it! there was someone else who could use this but forgot who ??

    Thank You
    Larry

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