.NET Framework - Windows Forms Control Library

Asked By Derek Hart
05-Mar-09 07:55 PM
I have a vb.net winforms application that I need to allow others to host
inside other winforms applications. I have just learned of the Windows Forms
Control Library. Can I make a control inside the Windows Forms Control
Library that inherits a form from the main winforms project. I simply don't
know the steps inside the control to inherit it properly and show the form.
Visual Studio
(1)
System.Windows.Forms
(1)
UserControl
(1)
Control
(1)
Library
(1)
Button
(1)
  MortenWennevi replied...
27-Mar-09 04:10 AM
Hi Derek,

If by Windows Forms Control Library you mean the project template in Visual
Studio, that is just a regular library project with a UserControl instead of
a Class file preadded as well as the necessary references to
System.Windows.Forms library.

To use and inherit from any library you simply need to add a reference to
the library.

using System.Windows.Forms;

public class MyButton : Button
{
}

The Button class resides in the System.Windows.Forms.dll so to be able to
inherit from Button you need to add a reference to System.Windows.Forms.


--
Happy Coding!
Morten Wennevik [C# MVP]
  dummy ahuja replied to MortenWennevi
23-Oct-10 12:28 PM
Create window forms control library

check this helpful link



http://www.mindstick.com/Articles/d1bc25c6-b686-4423-9cf0-147046d6e39d/
  dummy ahuja replied to dummy ahuja
23-Oct-10 12:38 PM
Create window forms control library



check this helpful link
help
it in dot.net? How can I do this is vb.net? VB.NET Discussions Visual Studio 2010 (1) Visual Studio (1) Silverlight (1) Windows 7 (1) Office (1) Vista (1) Linux (1) Error (1) HI crap that you could use as well :) - - Tom Shelton http: / / msdn.microsoft.com / en-us / library / 9s96f6ft(v = vs.71).aspx http: / / msdn.microsoft.com / en-us / library / system.drawing.printing.printdocument(v = VS.80).aspx http: / / www.vbdotnetheaven.com / has several articles it can be bothersome to access a specific name within the structure. For example, accessing System.Windows.Forms.Cursor.Current is a lot to type. Every time. For this reason, "Imports" are
wrote : Public Class MenuButton Inherits Panel . . . The code is not compiled : Error 1 Base class 'System.Windows.Forms.Panel' specified for class 'MenuButton' cannot be different from the base class 'System.Windows.Forms.UserControl' of one of its other partial types. I need little sample code, so I can go on . . ., please. Thanks :) VB.NET Discussions Visual Studio (1) MissingMethodException (1) UserControl (1) IDesigner (1) VB (1) Control (1) IDictionary (1) Compile
OnClick event name .NET Framework * ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** ** public class UserControl1 : System.Windows.Forms.UserControl { / / . . . public event EventHandler OnClick; / / . . . public void SomeFuncWhichFiresClickEvent() { / / . . . / / fire event if (OnClick ! = null) OnClick(this, new EventArgs()); } / / . . . }public class UserControl1 : System.Windows.Forms.UserControl { / / . . . public event EventHandler OnClick; / / . . . public void SomeFuncWhichFiresClickEvent() { / / . . . / / fire event if (OnClick ! = null) OnClick(this, new
Application m?chte ich ein Fenster Optionen realisieren, welches aussieht wie z.B. Optionen im Visual Studio. Somit ein Fenster, welches im linken Bereich die einzelnen Menupunkte ausw?hlt und im rechten rde ich das Fenster mittels TabControl realisieren.) Besten Dank vorab! Ciao, Alberto C# - German Discussions Visual Studio (1) System.Windows.Forms (1) UserControl (1) TabControl (1) TreeView (1) Application (1) Control (1) PropertyGrid (1) Hallo Alberto, ein fertiges
System.Runtime.InteropServices.ClassInterface (1) System.Runtime.InteropServices.ProgId (1) Microsoft.Win32.Registry.CurrentUser (1) System.Windows.Forms.UserControl (1) Microsoft.Win32.RegistryKey (1) ClassInterfaceType (1) DeleteSubKeyTree (1) Hallo Andy, schau mal ein paar de.german.entwickler.dotnet.csharp&tid = fdad8fa8-303e-44aa-8168-049b72ef6b01 - - Tschau, Stefan Microsoft MVP - Visual Developer ASP / ASP.NET http: / / www.asp-solutions.de / - Consulting, Development http: / / www.aspnetzone.de will) : [Exportieren aus einer DLL mithilfe von "_ _declspec(dllexport)"] http: / / msdn.microsoft.com / de-de / library / a90k134d.aspx ciao Frank - - Dipl.Inf. Frank Dzaebel [MCP / MVP C#] http: / / Dzaebel.NET Hallo xxxx-xxxx-xxxxxxxxxxxx")] [System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType.AutoDual)] public class SampleOcx : System.Windows.Forms.UserControl { [System.Runtime.InteropServices.ComRegisterFunction] static void ComRegister(Type t) { string keyName = @"CLSID \ " + t