Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > General .NET
|
General .NET For general discussion of MICROSOFT .NET topics that don't fall within any of the other .NET forum subcategories or .NET language forums.  If your question is specific to a language (C# or Visual Basic) or type of application (Windows Forms or ASP.Net) try an applicable forum category. ** PLEASE BE SPECIFIC WITH YOUR QUESTION ** When posting here, provide details regarding the Microsoft .NET language you are using and/or what type of application (Windows/Web Forms, etc) you are working in, if applicable to the question. This will help others answer the question without having to ask.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the General .NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 29th, 2006, 06:10 AM
Registered User
 
Join Date: Nov 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Bajrang
Default How to make an ActiveX control

Hi, i want to make an ActiveX control that is to be inherited from other Controls ( like text box And List Box). I need properties of both controls at design time when i use this ActiveX control in other Application.
I created this without inheritence and when i use this control, it shows only forms properties. Textbox and ListBox properties is not shown.
I needed both control's properties at design time , How it is possible. Please guide me.
thanks in advance

Bajrang
 
Old November 30th, 2006, 02:49 AM
Authorized User
 
Join Date: Feb 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to karthiklsimha
Default

Hi Bajrang,

You can write some properties in the ActiveX control class and set the property of the contained controls in them.

Example.
A ActiveX control has a text box called txt_box then the multiline property can be set by writing the below property in the ActiveX control class. This property will also be visible in the properties window in design time.

    Public Property IsMultiLine() As Boolean
        Get
            Return txt_Box.Multiline
        End Get
        Set(ByVal Value As Boolean)
            txt_Box.Multiline = Value
        End Set
    End Property

Additionaly you can use attributes to set the description text (which is shown in the property window).

Regards,
Karthik Simha
 
Old December 6th, 2006, 01:37 AM
Registered User
 
Join Date: Nov 2006
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Bajrang
Default

Thanks for reply.
Actually I need properties of both controls at design time when i use this control in other Applications.
I thinks its a long process to set/get all properties of both controls.
for this I have to findout types of these properties & methods.
Is there not any feasiblle methods so I can Just Inherit all properties & methods of these control and add required additional properties & methods .
Thanks again, Please reply


Bajrang
 
Old December 8th, 2006, 12:36 AM
Authorized User
 
Join Date: Feb 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to karthiklsimha
Default

Hi Bajrang,

You can change the access specifiers to public in the control declaration in user control. This will display the child controls itself as property.

For example
Change From

Friend WithEvents txt_Box As System.Windows.Forms.TextBox
Friend WithEvents btn_Click As System.Windows.Forms.Button

To

    Public WithEvents txt_Box As System.Windows.Forms.TextBox
    Public WithEvents btn_Click As System.Windows.Forms.Button

Then you will be able to set the property as

usercontrol1.txt_Box.MultiLine = True

Regards,
Karthik Simha





Similar Threads
Thread Thread Starter Forum Replies Last Post
An activex control to make VOIP serhatyusuf Visual C++ 1 February 10th, 2007 02:30 PM
ActiveX control for IE6 crmpicco VB How-To 3 January 17th, 2005 12:15 PM
ActiveX Control Required asifdahir Visual C++ 2 December 31st, 2004 07:29 PM
How do I use an ActiveX Control? ArtDecade VB.NET 2002/2003 Basics 5 September 18th, 2004 03:23 AM
Could not instantiate ActiveX control because the karthey VS.NET 2002/2003 0 July 1st, 2003 05:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.