transperancy related

the.kaushik

Member
Joined
Mar 4, 2007
Messages
16
Programming Experience
Beginner
friends i am using the following code to make my form transperent and using a png semi transperent image as background

VB.NET:
Expand Collapse Copy
Protected Overrides Sub OnPaintBackground(ByVal pevent As System.Windows.Forms.PaintEventArgs)
    Dim gfx As Drawing.Graphics = pevent.Graphicspevent
    gfx.DrawImage(Me.BackgroundImage, New Drawing.Rectangle(0, 0, Me.Width, Me.Height))
    End Sub
this function as u can see overrides the default background

i want to execute the same with a button click.. is it possible.. so that when i click a button this code executed alse it wont..

and one thing more.. in this way when i make my form transperent as soon as i move my form the transperency is lost.. is there any way to avoid so..
 
Last edited:
wrap an If statement around your code, so that the code only executes when a boolean global variable is true.

then in your button, add some code to toggle the global variable state.
 
ok i did that but was not able to make it work properly.. just check if u all can do something.. i am attaching the source code.. i tried for " form position change" to execute the code....
 

Attachments

Last edited by a moderator:
Back
Top