473,800 Members | 2,950 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1744
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(ByVa l sender As System.Object, _
ByVal e As System.EventArg s) 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******** ******@tk2msftn gp13.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(ByVa l sender As System.Object, _
ByVal e As System.EventArg s) 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******** ******@TK2MSFTN GP12.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.SQUA REBRACKETS.[mdaudi100#ntlwo rld.com]> wrote in
message news:%2******** ********@TK2MSF TNGP09.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******** ******@TK2MSFTN GP12.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
2199
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. I've found a way that works on the web, and I'm trying to get it to also work in debug mode in the IDE. The "on the web" page and my SQL database are hosted by a third party (on separate servers). Since debug mode opens IE and loads my page...
4
2660
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 library not being registered. Yet it shows up in the COM section when I added it to the toolbox, and shows up in the toolbox but I can't drop it on a form? I need to display a map and modify the map using code. I saw a demo of this a LONG time ago in...
0
1198
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 that allows the user to drag data, specifically a string, from another window to one of these controls, without success. Part of the control definition is: public class TactControl : UserControl {
2
1539
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. I want the controls on the leech form to get bound to a dataset and/or binding sources that reside on the host form. At the moment I just pass in the dataset by reference to the user control
0
9690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9550
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10250
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10032
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9085
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7574
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6811
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5469
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5603
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.