Hi,
I want to display a MDI form form ActiveX control. Do U have any idea how to do that? I know it's possible in VB.NET but I want to do it in VB.6.0
Uttam
Printable View
Hi,
I want to display a MDI form form ActiveX control. Do U have any idea how to do that? I know it's possible in VB.NET but I want to do it in VB.6.0
Uttam
My first thought is to set the parent of the form to the control. Another aproach might be to use another control inside the main one, and just make it *look* like a form.
Many thanks for reply but still I'm having problem in loading the form. I will be highly obliged if U send a small demo code for the same.
Thanks in advance!!!
Uttam
OK.
Here is a little demo to get you started. It even lets you minimize the MDI child inside the control.
Let us know how it goes!
Many many thanks. It solved my problems. Once again many thanks.
Hi,
Sorry for asking too many questions but the problem is:
I want to make it an ocx so that I can use the same in another application but it doesn't allow to do so. Could U plz let me know how can I make the project given by U as ActiveX Control?
Many Thanks in advance!!!
Uttam
OK. Start with your control only, and make the project an activex control type (in project properties). Then set the startup object to none. Now make your control public in the control's properties. Then add a regular form to the project (not an mdi).
Now when you compile it, the form will be part of the ocx!
Hi,
Sorry for asking lots of questions but when I'm trying to compile the OCX as U had told it's saying MDI form can not be shown modally.
Plz help me to to solve this problem.
I'm really very sorry but quite helpless.
Uttam
You don't add an MDI form to the project, because the API turns a regular form into an MDI form.
Here is a sample project, and it works like I said.
Hi,
I'm really very sorry for asking lots of questions but it think it would be my last question. Actually now when I'm trying to show MDIChild form on the MDI form it gives me problem. I'm attaching a sample code which is causing problem.
Once again many thanks in advance!!!
Regards;
Uttam
OK. I think I see what you are trying to do. Are you trying to put an MDI form inside the control, then have an MDIchild form inside of that? If so, I would say it is not likely to be possible, and at best would cause all sorts of problems. My suggestion is to make the control act as the parent form for the MDI child forms. If you want it to look like an MDI interface, I would simulate it, and not try to get the real thing. This is because the control is sited on a regular form, so I don't think it can be an MDI parent.
Very interresting subject.Quote:
Originally posted by WizBang
You don't add an MDI form to the project, because the API turns a regular form into an MDI form.
Here is a sample project, and it works like I said.
I tried your project and it works fine. But if :
- I build the project1.ocx
- Register the test1.ocx using regsvr32
- Edit an html page to loag the ocx
When load the page in IE 6.0, I have an 406 error message concerning non-modale forms....
Any Idea ???
Chris ZANARDI
I think U R not using correct version of ocx coz it works alright on my M/C
Well, I don't understand what you mean with 'not using correct version of ocx ' coz if I see in the html page the pink rectangle with the button...
OK, can you try on your computer this example : it is the same as the original one exept concerning the DEBUG proporties of the project. Instead of 'start with the component UserControl1', I 'start a browser with the URL...'
Thank you and sorry to disturb you.
Chris
Well, Got ur problem. Try this code to. I mean replace the given function. It will work fine in ur case.
Private Sub MakeMDI()
'Make window act like MDI child and also so it won't show in the taskbar
lhWnd = MDIChild.hWnd
SetParent MDIChild.hWnd, UserControl.hWnd
MDIChild.Visible = 1
End Sub
Uttam