Visual Basic 5 to Stamp (VB Help)
L_Gaminde
Posts: 29
Im working on a VB5 to stamp project, I need some help with a text box. Im unable to scroll data to this box using multiline and scroll bar, vbCrLf does not work chr(13) & chr(10) nothing works. if I put the vbCrLf as the first item on the line it drops down one line and prints all input on that line instead of scrolling.
This is time and date data from the stamp and a 1307 rtc. I am able to scroll into a picture box using print. I have tried to break each byte out used the string, used formatting it all works in the picture window but scrolls off page picture windows do not have scroll bars so some data gets lost.
This is time and date data from the stamp and a 1307 rtc. I am able to scroll into a picture box using print. I have tried to break each byte out used the string, used formatting it all works in the picture window but scrolls off page picture windows do not have scroll bars so some data gets lost.
Comments
example
Dim x As Integer
For x = 0 To 5
List1.AddItem ("YO" + vbCr)
Next
Jeff T.
Txttout.text = Chr(32) & Chr(32) & Chr(32) & Chr(32) & Chr(32) & Chr(32) & Chr(32) & byte1 & byte2 & Chr(58) & byte3 & byte4 & Chr(32) & Chr(32) & byte5 & byte6 & Chr(47) & byte7 & byte8 & vbcrlf
Ha! I've got exactly the same issue. I am recording date, time, temperature, and humidity via a BS2 and Sensirion Temperature/Humidity Sensor and VB6. Although I would like for the data to look nice on the screen, it is not too important since I write it to disk for later use.
Still, it WOULD be good if it looked nice on the screen!
I haven't cut VB code in a long, long time so I am out of practice and have forgotten a lot. I'll try the list box idea. Currently, I am using a text box. I wonder if it has something to do with the serial input buffer length?
--Bill
I think its a variable thing the data is there and correct just can't make it go to the next line using " " works but then its not a vairable.
Try using a Picture box and using the print statement with a variable mystr or any name or number of varialbes and it works great but you lose data when the box is full and there is no way of scrolling a picture box ( or is there ).
picture1.print mystr 'this works great till box is full
i also write it to disk but I feel like an idiot not being able to make this work!!
What level of scrolling are you looking for?
Here is a You-Tube link to something I was toying with written in VB4 ...
http://www.youtube.com/user/ICPolyman#p/a/u/0/xl2F4oHtvhE
...It graphically scrolls a PictureBox using the native tools to make a 'ticker tape'... i.e. no API calls
With graphics it's a bit complex, but if you are just wanting to do text, then your already on the right track.
Your example ...
"picture1.print mystr 'this works great till box is full"
might just need a little overhead maintenance. Such as using the MID function with 'mystr' to limit what is printed. Also you might need to make use of ...
"Picture1.CurrentX" and "Picture1.CurrentY"
...to manually re-position your cursor prior to printing partial MID segments of 'mystr'.
Doing that should allow you to scroll in any direction.
Here is a text box example that uses various data types in a loop , it takes a variable byte a variable string the constant vbNewLine and uses the Space(n) instruction. The two properties to change in the text control are MultiLine=True and ScrollBars=Vertical
Dim x As Byte
Dim mytext As String
mytext = "hello" & vbNewLine
Text1.Text = ""
For x = 0 To 100
Text1.Text = Text1.Text & x & Space(2) & mytext
Next
If the newline is to be controlled by the device and not the VB app then append Chr(13) & Chr(10) to the string.
Jeff T.
Jeff T.
Sorry to Hi-jack your thread. Attached at the bottom of this page is a VB4 example for fine text scrolling. Click on the picture box to start the demo.
Unsoundcode,
Thanks... "is the source available?" - it will be when I work out more of the code. Right now the Analog meters are locked to the bar graphs for testing purposes of building the meters, but the Spin code is simple...
...The Analog meters would code in a similar way.
Beau It will be weeks for me to digest this so don't go anywhere I will get back to you.
Text1.SelStart = Len(Text1) 'Finds the starting point to append text
Text1.SelText = mystr & vbCrLf 'Appends text
Thanks to rsocor01 from another list
Thank you very much!
--Bill