Hello,
I am creating and ActiveX user control. It is a title bar with exit minimize maximize buttons. Does anyone know how i can interact(send commands) with the main form that the user control will be on? Is there a keyword for it?
Thanks.
Hello,
I am creating and ActiveX user control. It is a title bar with exit minimize maximize buttons. Does anyone know how i can interact(send commands) with the main form that the user control will be on? Is there a keyword for it?
Thanks.
Use Extender.Parent
Best regards
Public Declare Function ReleaseCapture Lib "user32" Alias "ReleaseCapture" () As Long
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Public Const WM_CLOSE = &H10
Public Const WM_NCLBUTTONDOWN = &HA1
Public Const WM_SIZE = &H5
Public Const SIZE_MAXHIDE = 4
Public Const SIZE_MAXIMIZED = 2
Public Const SIZE_MAXSHOW = 3
Public Const SIZE_MINIMIZED = 1
Public Const SIZE_RESTORED = 0
You will need this to create a titlebar I think. Let's have a look at Sendmessage:
hwnd=hwnd of the window where your control is on.
wMsg = one of the WM_ messages
wParam = In case that wMsg = WM_SIZE use SIZE_ constants
lParam = Case WM_Close: lparam = 0, WM_NCL.. specify coordinates, but for this case you can use 0, WM_SIZE: width = loword, height = hiword of lparam.
Use this for dragging the window
Private Sub Usercontrol_MouseDown(params)
releasecapture
sendmessage parent.hwnd, wm_nclbuttondown, 0, 0
end sub
This should work
Oh I see someone else has posted while I was doing so much work :(. Ah doesn't matter, you can choose now what you want to use, and I'm going to look at his way. Maybe it's better, I don't know.
Thanks a lot guys:)
hi,Quote:
Originally Posted by Joacim Andersson
How come this "Extender.Parent" is not working in IE?
PS:
I have an aspx page that holds an activex control.
In this control I want to :
Extender.Parent.Textbox1.Text = "Hello!"
But nothing happens when I load the page. This works though in VB exe.
Is there a way I can make it work?