hi all pros,

below is my vb6.0 code. the click command is to save my text and picture. there is no problem for my text.
but, i have a problem after saving the picture. the picture can be saved but it is not availabe for preview.
is there any fix for this ?

Private Sub Command2_Click()
Dim namefile
namefile = Text2 + Text3
Open App.Path & ("/" + namefile + ".txt") For Output As #1
Print #1, Label5.Caption + Text3.Text & vbNewLine; Label6.Caption + Text4.Text & vbNewLine; Label7.Caption + Text5.Text & vbNewLine; Label8.Caption + Text6.Text & vbNewLine; Label9.Caption + Text7.Text & vbNewLine; Label10.Caption + Text8.Text & vbNewLine; Label11.Caption + Text9.Text & vbNewLine; Label12.Caption + Text10.Text & vbNewLine; Label13.Caption + Text11.Text & vbNewLine; Label14.Caption + Text12.Text & vbNewLine; Label15.Caption + Text13.Text & vbNewLine;
Close #1

Dim namefile2
namefile = Text2 + Text3
Open App.Path & ("/" + namefile + ".bmp") For Output As #2
Print #2, Picture1; PictureBox
Close #2
End Sub

please assist! thakns alot!

Recommended Answers

below is my vb6.0 code. the click command is to save my text and picture. there is no problem for my text. but, i have a problem after saving the picture. the picture can be saved but it is not availabe for preview. is there any fix for this …

Jump to Post

All 5 Replies

Re: Saving Picture in Visual Basic 6.0 80 80

below is my vb6.0 code. the click command is to save my text and picture. there is no problem for my text. but, i have a problem after saving the picture. the picture can be saved but it is not availabe for preview. is there any fix for this ?

To save picture in PictureBox you should use SavePicture() function :

Dim namefile2
namefile = App.Path & ("/" & Text1 + Text2) & ".bmp"
SavePicture Picture1.Image, namefile
commented: :D +1
commented: - +1
commented: agree +13
Re: Saving Picture in Visual Basic 6.0 80 80

variable namefile2 is assigned the nextline namefile

Re: Saving Picture in Visual Basic 6.0 80 80

Jx_Man u rocks to the max!!! now i can save my picture from the picture box!!!

Re: Saving Picture in Visual Basic 6.0 80 80

thanks everyone that help me !!

Re: Saving Picture in Visual Basic 6.0 80 80

You're welcome :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.