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)?
Printable View
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)?
hello dadash
there is an icon property for the form:rolleyes:
edit: umm you mean how to change the menu itself? hmm definatly some API calls:D
api calls, can you tell me more?!
any idea where i can search for the api i need.
or is there easier ways?!
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 .
the menu is the thing i want to change! anyone has experience? knows which api to use?
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
thats true, i tried that, then i had problems trying to drag the form around
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.
It's easy . By this code you can move the form by clicking even in the center of the form .Quote:
Originally posted by persianboy
thats true, i tried that, then i had problems trying to drag the form around
VB Code:
Private Declare Function ReleaseCapture Lib "user32" () As Long 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 Private Const WM_NCLBUTTONDOWN As Integer = &HA1 Private Const HTCAPTION As Integer = 2 Public Sub New() 'Me.Text = "Drag anywhere to move" AddHandler Me.MouseDown, AddressOf frmMain_MouseDown End Sub Private Sub frmMain_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) 'Don't drag the sceen if it is the right button or the wheel. If e.Button = MouseButtons.Left Then ReleaseCapture() SendMessage(Me.Handle, WM_NCLBUTTONDOWN, HTCAPTION, 0) End If End Sub
its working fine!!! thanks!