Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Pro VB.NET 2002/2003 For advanced Visual Basic coders working .NET version 2002/2003. Beginning-level questions will be redirected to other forums, including Beginning VB.NET.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro VB.NET 2002/2003 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
  #1 (permalink)  
Old October 23rd, 2003, 04:39 AM
Authorized User
 
Join Date: Jun 2003
Location: Norfolk, , United Kingdom.
Posts: 63
Thanks: 0
Thanked 0 Times in 0 Posts
Default User Controls

Hi Guys

I'm creating a User Control, one of the controls required is a textbox. When I add the text box to the user control I can see all the usuall properties of the text box. But when I add the user control to the form in the project only some of the properties are visible. The property I require is the CharacterCasing, I can get this property to appear by adding a Public property to the user control code, but I keep getting an overflow error when setting the property.

<Category("Apperance"), Description("Sets text Casing"), Browsable(True), Defaultvalue("Normal")>_
Public Property Casing as CharacterCasing
Get
Return Casing
End Get
Set (ByVal Value as CharacterCasing)
Casing = Value
End set
End Property

A Little help required, Thanks

Duncan
__________________
Duncan
  #2 (permalink)  
Old October 27th, 2003, 12:51 PM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Your overflow is most likely being caused by the circular reference in the property:

Public Property Casing as CharacterCasing
    Get
        Return Casing
    End Get
    Set (ByVal Value as CharacterCasing)
        Casing = Value
    End set
End Property

That code calls itself. Sounds like what you want to do is use this property to access the property of your text box:

Public Property Casing as CharacterCasing
    Get
        Return textbox1.CharacterCasing
    End Get
    Set (ByVal Value as CharacterCasing)
        textbox1.CharacterCasing = Value
    End set
End Property


Peter


Similar Threads
Thread Thread Starter Forum Replies Last Post
User controls dcct84 C# 2 October 28th, 2007 07:20 PM
User controls' content: Chapter 2 User Controls AGS BOOK: Professional ASP.NET 2.0 Server Control and Component Development ISBN: 978-0-471-79350-2 10 July 26th, 2007 05:36 AM
User Controls Lofa ASP.NET 1.0 and 1.1 Basics 2 February 13th, 2006 01:04 PM
User Controls..... Help please cowboy2066 General .NET 2 July 28th, 2004 09:22 AM
User Controls Duncan Pro VB.NET 2002/2003 2 December 1st, 2003 05:41 AM





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