BackgroundImage

Lanc1988

Contributor
Joined
Nov 27, 2003
Messages
508
Is there a way to change the backgroundimage on a form? i tried things like frmMain.BackgroundImage("path") but it doesnt work for me.. is it possible and if so how?
 
no, i was just trying to change the main form.. i found out all i had to do what put Me.BackgroundImage and now it works great.. thanks :)
 
now im having a problem finding the code to change the backgroundimage of my tabcontrol tabs.

they are on the main form and so is the button that will change the backgroundimage.. i tried:
TabControl1.TabIndex(tabNews).BackgroundImage = Image.FromFile(Application.StartupPath & "\Sidekick Files\Program Images\background.jpg")

but it wont work. how can i fix it?
 
Try:

Dim gr As Graphics = Me.TabControl1.CreateGraphics()
Dim rect As Rectangle = Me.TabControl1.GetTabRect(tabNews)

gr.DrawImage(New Bitmap(Application.StartupPath & "\Sidekick Files\Program Images\background.jpg"), rect)
 
Back
Top