|
-
Sep 24th, 2003, 12:40 PM
#1
Thread Starter
Addicted Member
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.
-
Sep 24th, 2003, 12:49 PM
#2
-
Sep 24th, 2003, 12:52 PM
#3
Thread Starter
Addicted Member
api calls, can you tell me more?!
any idea where i can search for the api i need.
or is there easier ways?!
-
Sep 24th, 2003, 01:56 PM
#4
Sleep mode
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 .
-
Sep 25th, 2003, 04:59 PM
#5
Thread Starter
Addicted Member
the menu is the thing i want to change! anyone has experience? knows which api to use?
-
Sep 25th, 2003, 05:50 PM
#6
Member
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
-
Sep 25th, 2003, 06:01 PM
#7
Thread Starter
Addicted Member
thats true, i tried that, then i had problems trying to drag the form around
-
Sep 25th, 2003, 06:20 PM
#8
Member
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.
-
Sep 26th, 2003, 10:31 AM
#9
Sleep mode
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:
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
-
Sep 26th, 2003, 12:30 PM
#10
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|