Wrox Programmer Forums
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To 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 June 16th, 2003, 01:36 PM
Registered User
 
Join Date: Jun 2003
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default UserControl withFlexGrid

I've created a User Control with an MS Flex Grid on it. The ControlContainer Property is set to True. When I attempt to add a control using the following code:

MSFlexGrid1.Parent.Controls.Add "VB.combobox", "ComboBox1", MSFlexGrid1.Container

I get this error: 438 - Object doesn't support this property of method.

Using the exact same scenario, except on a Form instead of a grid, this code works perfectly.

What's the problem?
 
Old June 24th, 2003, 12:20 PM
Authorized User
 
Join Date: Jun 2003
Posts: 78
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Add the 3 following property to your User Control and it should work

Code:
Public Property Get Controls() As Object
  Set Controls = UserControl.Controls
End Property

Public Property Get Parent() As Object
  Set Parent = UserControl.Parent
End Property

Public Property Get Name() As String
  Name = UserControl.Name
End Property
Stéphane





Similar Threads
Thread Thread Starter Forum Replies Last Post
ArrayList with UserControl rhd110 General .NET 2 August 12th, 2007 12:29 PM
usercontrol and javascript Hanch ASP.NET 2.0 Basics 1 March 7th, 2007 08:38 AM
Usercontrol properties. chakravarthy_vb General .NET 1 March 31st, 2005 02:39 AM
Refresh UserControl jpfree71 ASP.NET 1.0 and 1.1 Basics 3 August 17th, 2004 12:31 PM
a usercontrol problem csc820203 C# 2 July 10th, 2004 10:55 AM





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