|
-
Nov 24th, 2003, 01:27 AM
#1
Thread Starter
New Member
make form transparent while moving and otherwise solid
Hi
I am trying to make a form transparent (by reducing the opacity to around 70%) if/when the form is being moved around the screen, but at all other times the form should be solid.
I have no problem setting the opacity for the form when it moves by doing the following:
VB Code:
Public Sub moveForm(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Move
Me.Opacity = 0.7
End Sub
but the form then stays transparent, how do I set the opacity back to 100% again?
It's probably something really easy, but I can't work it out.
-
Nov 24th, 2003, 03:10 AM
#2
i built you a quick example , hope it helps.
VB Code:
[Color=Blue]Private[/color] dragging [Color=Blue]As[/color] [Color=Blue]Boolean[/color] = [Color=Blue]False
[/color] [Color=Blue]Protected[/color] [Color=Blue]Overrides[/color] [Color=Blue]Sub[/color] WndProc([Color=Blue]ByRef[/color] m [Color=Blue]As[/color] Message)
[Color=Blue]If[/color] m.Msg = 3 [Color=Blue]Then
[/color] dragging = [Color=Blue]True
[/color] [Color=Blue]ElseIf[/color] m.Msg = 160 [Color=Blue]Then
[/color] dragging = [Color=Blue]False
[/color] [Color=Blue]Me[/color].Opacity = 1
[Color=Blue]End[/color] [Color=Blue]If
[/color] [Color=Blue]MyBase[/color].WndProc(m)
[Color=Blue]End[/color] [Color=Blue]Sub
[/color] [Color=Blue]Protected[/color] [Color=Blue]Overrides[/color] [Color=Blue]Sub[/color] OnMove([Color=Blue]ByVal[/color] e [Color=Blue]As[/color] System.EventArgs)
[Color=Blue]If[/color] dragging [Color=Blue]Then
[/color] [Color=Blue]Me[/color].Opacity = 0.7
[Color=Blue]Else
[/color] [Color=Blue]Me[/color].Opacity = 1
[Color=Blue]End[/color] [Color=Blue]If
[/color] [Color=Blue]End[/color] [Color=Blue]Sub[/color]
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
-
Nov 24th, 2003, 03:45 AM
#3
Thread Starter
New Member
-
Nov 24th, 2003, 04:57 AM
#4
New Member
Can someone post a link to a list of m.msg ID numbers, or do they appear in the .Net Help files somewhere?
TIA
Ken
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|