Results 1 to 4 of 4

Thread: make form transparent while moving and otherwise solid

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Location
    Sydney
    Posts
    9

    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:
    1. Public Sub moveForm(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Move
    2.    Me.Opacity = 0.7
    3. 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.

  2. #2
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    i built you a quick example , hope it helps.
    VB Code:
    1. [Color=Blue]Private[/color] dragging [Color=Blue]As[/color] [Color=Blue]Boolean[/color] = [Color=Blue]False
    2.  
    3. [/color]    [Color=Blue]Protected[/color] [Color=Blue]Overrides[/color] [Color=Blue]Sub[/color] WndProc([Color=Blue]ByRef[/color] m [Color=Blue]As[/color] Message)
    4.         [Color=Blue]If[/color] m.Msg = 3 [Color=Blue]Then
    5. [/color]            dragging = [Color=Blue]True
    6. [/color]        [Color=Blue]ElseIf[/color] m.Msg = 160 [Color=Blue]Then
    7. [/color]            dragging = [Color=Blue]False
    8. [/color]            [Color=Blue]Me[/color].Opacity = 1
    9.         [Color=Blue]End[/color] [Color=Blue]If
    10. [/color]        [Color=Blue]MyBase[/color].WndProc(m)
    11.     [Color=Blue]End[/color] [Color=Blue]Sub
    12.  
    13. [/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)
    14.         [Color=Blue]If[/color] dragging [Color=Blue]Then
    15. [/color]            [Color=Blue]Me[/color].Opacity = 0.7
    16.         [Color=Blue]Else
    17. [/color]            [Color=Blue]Me[/color].Opacity = 1
    18.         [Color=Blue]End[/color] [Color=Blue]If
    19. [/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]

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2000
    Location
    Sydney
    Posts
    9
    thanks

  4. #4
    New Member
    Join Date
    Nov 2003
    Location
    NW England
    Posts
    1
    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
  •  



Click Here to Expand Forum to Full Width