473,325 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

File input help

I use VB6.
Expand|Select|Wrap|Line Numbers
  1. Dim nnumber As Integer: Dim sName As String
  2. Private Sub Command1_Click()
  3. Open "input1.txt" For Input As 1
  4.     Do Until EOF(1)
  5.         Input #1, sName, nnumber
  6.         List1.AddItem sName
  7.     Loop
  8. End Sub
  9. Private Sub List1_Click()
  10.     Picture1.Print nnumber
  11. End Sub
  12.  
I am trying to get the output user's total to a picturebox when they click on a listbox.

My input file goes as following
Expand|Select|Wrap|Line Numbers
  1. Bob
  2. 200
  3. Mike
  4. 232
  5. Dick
  6. 2322
  7.  
Dec 17 '07 #1
3 1055
Torgg
41
Give this a try

Expand|Select|Wrap|Line Numbers
  1.  
  2. Private Sub List1_Click()    
  3.     Dim objPrint As Object
  4.     Set objPrint = Picture1
  5.     objPrint.Font.Name = "Arial"
  6.     objPrint.FontSize = "10"
  7.  
  8.     objPrint.Print "123456 TEST"
  9. End Sub
  10.  
Torgg
Dec 17 '07 #2
I don't get it, can you explain what your code is suppose to do?
Dec 17 '07 #3
Torgg
41
I don't get it, can you explain what your code is suppose to do?
I'm setting up an object then I set the object to the Picture1 box then I set the font. I then put some text in the object and that text shows in the Picture1 box. This is how you do a "Print Preview" with a Picture box. You should be able to just copy and paste the code below right into your List1_Click event.

Private Sub List1_Click()
Dim objPrint As Object
Set objPrint = Picture1
objPrint.Font.Name = "Arial"
objPrint.FontSize = "10"

objPrint.Print nnumber
End Sub

I hope you found this helpfull,
Torgg
Dec 18 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Muttly | last post by:
Hey all. I'm trying to upload multiple files. I'm using the chm file from php.net to help me figure it out. I also checked online and say theres a problem with the file. Anyway My html looks like...
2
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give...
4
by: M P | last post by:
Can you help me find an asp code that will upload a file from my PC to web server? Mark
5
by: Gregg | last post by:
Hello all, I have been banging my head over a problem that I am having reading a comma seperated file (CSV) that can contain from 1 to 10,000 records. My code snipit is as follows: **Start...
18
by: Jen | last post by:
I'm using Microsoft's own VB.NET FTP Example: http://support.microsoft.com/default.aspx?scid=kb;en-us;832679 I can get the program to create directories, change directories, etc., but I can't...
6
by: Lenny Wintfeld | last post by:
Hi I'm attempting additions/changes to a Java program that (among other things) uses XSLT to transform a large (96 Mb) XML file. It runs fine on small XML files but generates OutOfMemory...
3
by: RedRoses | last post by:
Hey guys i really need ur help in my C++ assignment , its very hard 4 me coz its the first time 4 me to take a course in programming or anything related to computer !!! :s so plzzzzzzzzz help me...
24
by: allpervasive | last post by:
hi all, this is reddy, a beginner to c lang,,here i have some problems in reading and modifying the contents of a file,, hope you can help to solve this problem. Here i attach the file to be...
2
by: Killer42 | last post by:
The Input #1 statement simply reads in one line from a text file (in this case you INI file) and places the values from it into one or more variables. So what you are reading in this statement is...
4
cassbiz
by: cassbiz | last post by:
Could use some help here. This script is carrying over an image just fine but the text isn't coming over. can you see why it is not working???? from the form I want to carry over two lines of...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.