Results 1 to 10 of 10

Thread: picturebox

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Posts
    166

    picturebox

    hello everyone !

    i've a graph in a picturebox. i justwant to change the labels in the picturebox at the click of a button. i'm using picture1.print for the same. now the prob is when i cliock on the button, the labels are not getting refreshed. i'm using picture1.refresh after picture1.print .... but no use !

    but when i draw the graph again with a new set of values, and then display the labels ... the labels are shown correctly.

    tell me some way to refresh the picturebox to show the current labels at the click of a button.

    thanks

    shruti !

  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    I am a little confused by your question here. If you are using a label control, why are you using the Picture1.Print method to write to the label.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2002
    Posts
    166
    i'm not using a label control,
    by label i mean the label on the graph used to display the x-axis labels. which keep changing at a click. i want to change the labels on the click using print method. but my prob is refreshing it .....
    i hope i'm making some sense.....


    shruti !

  4. #4
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573
    I'm somewhat confused as well. If you place the code in the click method to print the labels why shouldn't they be reprinted every time you click on it? What are you exactly trying to do?

  5. #5
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575

    Question me three!

    Yea, me three, i am confused on this too. I dunno what exactly ur trying to do with the print command... doesnt the print command write text into a file?
    like say:
    VB Code:
    1. Private Sub Command1_Click()
    2. Open C:\File.txt For Output As #1 ' opens the file
    3. Print #1, "Text here which prints into the file on first line"
    4. Print #1, "Text here on second line"
    5. Print #1, "" ' makes a blank line, i think...
    6. Print #1, "Then you get this on the 4th line yes?"
    7. Close #1
    8. End Sub

    Isnt that what the print command does? not anything to with pictures? I may be wrong, but that is what i thought.
    Last edited by LITHIA; Dec 31st, 2002 at 04:56 AM.

  6. #6
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    Is the graph you are using a different control? In that case, you will have to refresh the Graph control instead of the PictureBox.
    Last edited by amitabh; Dec 31st, 2002 at 05:07 AM.

  7. #7
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    LITHIA,
    You can use the Print Function to Print on a form or a PictureBox too. Try this code:
    VB Code:
    1. Me.Print "Print to Form"
    2. Picture1.Print "Print to PictureBox"

  8. #8
    vbuggy krtxmrtz's Avatar
    Join Date
    May 2002
    Location
    In a probability cloud
    Posts
    5,573
    I think it's more efficient if you use labels on the picturebox. Then every time you make changes to them you don't need to clear the picture to avoid printing over the previous stuff. Moreover you control labels easily by playing around with the visible property.

  9. #9
    PowerPoster
    Join Date
    Aug 2000
    Location
    India
    Posts
    2,288
    Yes, a lable would definitely be a more better option if you can use one.

  10. #10
    Fanatic Member LITHIA's Avatar
    Join Date
    Dec 2002
    Location
    UK, England
    Posts
    575
    oooooohhhhhhhh.... interestin, any more info on print command? what does it actually do with picturebox's or forms then?

Posting Permissions

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



Click Here to Expand Forum to Full Width