Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Form Background - Picture

Status
Not open for further replies.

aviles1973

Programmer
May 19, 2002
25
US
I have installed VB.net and used it but don't need it for the application I am writing. However I wish I could just use the Forms, Buttons, Textboxes, etc in VB6 from VB.net First of all, is this possible? I learned by browsing the net that I could use Windows Forms 2.0 and that was very useful. My problem now is when I make the form.picture = whatever.gif
its only draws the picture in the left corner. I need to know if anyone knows how to have a picture cover the whole background of the form like when you assign a picture to the form.picture property in vb.net. It redraws itself on the backround several times to cover the whole form.
 
Try this, place your picture into a picturebox named 'Picture1' and set the visible property to 'false' and auto resize to 'true'.

Now add this code in the Form_Resize() Event...

Private Sub Form_Resize()
Dim y As Integer
Dim x As Integer
If Me.WindowState = 1 Then Exit Sub
Me.Refresh
For x = 0 To Form1.Height
For y = 0 To Form1.Width
Form1.PaintPicture Picture1.Picture, y, x
y = y + Picture1.Width
Next y
x = x + Picture1.Height
Next x
End Sub

Good Luck!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top