473,395 Members | 1,341 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

How to Host a Windows Form in a User Control

Can anyone think how I could get a user control to host a Windows form? In
fact, what I actually want to do is have a docked toolwindow within a user
control, along with another user control.

The reason I want to do this is because I am creating an add-in for the VS
IDE, and when creating a toolwindow for an add-in it needs to be a control
hosted in a shim ActiveX control ... or that is what I have found. If anyone
has an alternative suggestion then that would also be most welcome.

TIA

Charles
Nov 21 '05 #1
4 1714
Charles,

In my opinion is this an answer on what your ask, however what is the real
problem.

-:)

\\\ I have draged a panel on a form
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim frm As New formCharles
frm.TopLevel = False
frm.Parent = Panel1
frm.Show()
End Sub
End Class
Public Class formCharles
Inherits System.Windows.Forms.Form
End Class
///

Hower I hope this helps,

Cor
Nov 21 '05 #2
Hi Cor

Thanks for the example. I think I may have mis-remembered what is available
with .NET out of the box. I have been using Infragistics for so long that I
thought that dockable tool windows were a part of basic .NET, but it looks
like they are not.

When I do something similar to what you have shown, I get the form within a
form effect, but it does not remain docked. I guess I will have to resort to
using the Infragistics DockManager.

Charles
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:uI**************@tk2msftngp13.phx.gbl...
Charles,

In my opinion is this an answer on what your ask, however what is the real
problem.

-:)

\\\ I have draged a panel on a form
Private Sub Form1_Load(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles MyBase.Load
Dim frm As New formCharles
frm.TopLevel = False
frm.Parent = Panel1
frm.Show()
End Sub
End Class
Public Class formCharles
Inherits System.Windows.Forms.Form
End Class
///

Hower I hope this helps,

Cor

Nov 21 '05 #3
http://www.dotnetrix.co.uk/misc.html --> Add forms as user controls.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Charles Law" <bl***@nowhere.com> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
Can anyone think how I could get a user control to host a Windows form? In
fact, what I actually want to do is have a docked toolwindow within a user
control, along with another user control.

The reason I want to do this is because I am creating an add-in for the VS
IDE, and when creating a toolwindow for an add-in it needs to be a control
hosted in a shim ActiveX control ... or that is what I have found. If
anyone has an alternative suggestion then that would also be most welcome.

TIA

Charles

Nov 21 '05 #4
Thanks Mike. I will take a look.

Charles
"Mick Doherty"
<EX***********@AND.REMOVE.SQUAREBRACKETS.[mdaudi100#ntlworld.com]> wrote in
message news:%2****************@TK2MSFTNGP09.phx.gbl...
http://www.dotnetrix.co.uk/misc.html --> Add forms as user controls.

--
Mick Doherty
http://dotnetrix.co.uk/nothing.html
"Charles Law" <bl***@nowhere.com> wrote in message
news:OV**************@TK2MSFTNGP12.phx.gbl...
Can anyone think how I could get a user control to host a Windows form?
In fact, what I actually want to do is have a docked toolwindow within a
user control, along with another user control.

The reason I want to do this is because I am creating an add-in for the
VS IDE, and when creating a toolwindow for an add-in it needs to be a
control hosted in a shim ActiveX control ... or that is what I have
found. If anyone has an alternative suggestion then that would also be
most welcome.

TIA

Charles


Nov 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jeff | last post by:
I have an ASP.NET web page accessing a SQL database. I've used VS to build the app and stored it in the eNPTest02 directory of my localhost on my development machine. The database is on the web. ...
4
by: balmerch | last post by:
Is there a way to host the mappoint control in vb.net? I don't want to use the web service because the destination system will not have internet. I tried to host it and got an error about the...
0
by: DrBonzo | last post by:
I've inherited a body of C# code that has a 'Designer Host' (DH) based UI. Custom controls are selected from a 'toolbox' window and placed/sized in the DH interface. I'm trying to add a feature...
2
by: John Sheppard | last post by:
Hello there, I have a dataset on a form...I shall call the host form. I also have a user control with a whole bunch of textboxes and gridviewcontrols on it. I shall call this the leech form. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.