|
-
Nov 4th, 2001, 08:50 AM
#1
Thread Starter
New Member
How Can I Interact With The Main Form FromThe The Activex User Control?
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.
-
Nov 4th, 2001, 09:04 AM
#2
Use Extender.Parent
Best regards
-
Nov 4th, 2001, 09:07 AM
#3
Hyperactive Member
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
-
Nov 4th, 2001, 09:11 AM
#4
Hyperactive Member
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.
-
Nov 4th, 2001, 09:14 AM
#5
Thread Starter
New Member
Thanks a lot guys
-
Jun 3rd, 2007, 09:20 PM
#6
Member
Re: How Can I Interact With The Main Form FromThe The Activex User Control?
 Originally Posted by Joacim Andersson
Use Extender.Parent
Best regards
hi,
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?
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
|