Results 1 to 10 of 10

Thread: change form's icon context menu?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227

    change form's icon context menu?

    hi,
    how can we change the context menu object of the form's icon ( the one on the top left corner of the form, before the form's title)?
    Last edited by persianboy; Sep 24th, 2003 at 12:43 PM.

  2. #2
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    hello dadash
    there is an icon property for the form


    edit: umm you mean how to change the menu itself? hmm definatly some API calls
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    api calls, can you tell me more?!
    any idea where i can search for the api i need.

    or is there easier ways?!

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    If the menu is what you are talking about , and yo want to diable or add or remove to it , then APIs but I don't know which one of them .

    If the icon is your problem , then check the Icon Property of the form .

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    the menu is the thing i want to change! anyone has experience? knows which api to use?

  6. #6
    Member
    Join Date
    Sep 2003
    Posts
    40
    okay.. an easy and wrong answer would be to change ur formborderstyle to fixed dialog/tool and the menu will disappear, but u'll have a bad looking close button.
    --
    MY way(as a beginner) of doing what u want to do is to make the form borderless, and draw the top bar myself, then include a context menu for a small picture on the left and customize it anyway i like. but then again, that's just my way of doing it, and u should probably consult a more professional user.

    later

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    thats true, i tried that, then i had problems trying to drag the form around

  8. #8
    Member
    Join Date
    Sep 2003
    Posts
    40
    good point lol

    maybe add a drag/drop procedure to the created bar, that changes to coordinates of the main program relative to the screen? i never worked with dragdrop so can't be sure that'll work.

  9. #9
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Originally posted by persianboy
    thats true, i tried that, then i had problems trying to drag the form around
    It's easy . By this code you can move the form by clicking even in the center of the form .

    VB Code:
    1. Private Declare Function ReleaseCapture Lib "user32" () As Long
    2.     Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As IntPtr, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As Integer) As Integer
    3.  
    4.     Private Const WM_NCLBUTTONDOWN As Integer = &HA1
    5.     Private Const HTCAPTION As Integer = 2
    6.  
    7.     Public Sub New()
    8.         'Me.Text = "Drag anywhere to move"
    9.         AddHandler Me.MouseDown, AddressOf frmMain_MouseDown
    10.     End Sub
    11.  
    12.     Private Sub frmMain_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs)
    13.         'Don't drag the sceen if it is the right button or the wheel.
    14.         If e.Button = MouseButtons.Left Then
    15.             ReleaseCapture()
    16.             SendMessage(Me.Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0)
    17.         End If
    18.     End Sub

  10. #10

    Thread Starter
    Addicted Member
    Join Date
    Sep 2003
    Posts
    227
    its working fine!!! thanks!

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