|
-
Apr 23rd, 2004, 01:22 PM
#1
Thread Starter
Frenzied Member
Custom Control
Okay, here is the dilemma.
I have created a custom control that consists of a textbox and an optional required field validator.
Everything works fine except for one minor problem.
I have overridden some of the properties, such as Font, BackColor, BorderStyle, etc.. and have made these properties invisible in the properties window, using <Browsable(False)> _.
The problem is, in the code-behind (using VS.NET) Intellisense still displays the hidden properties.
All the examples I have seen say to use the EditorBrowsable(EditorBrowsableState.Never) attribute to prevent Intellisense from displaying it, but this isn't working....
Here's a sample control I created to test this.
Code:
Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.ComponentModel
Imports System.Drawing
Public Class MyTextBox
Inherits TextBox
Private txtBox As TextBox
Public Sub New()
txtBox = New TextBox
End Sub
Protected Overrides Sub render(ByVal writer As HtmlTextWriter)
MyBase.Render(writer)
End Sub
Browsable - prevents the property from being seen in the properties window...This works
EditorBrowsable - prevents the property from being referenced in intellisense
in the code-behind...This doesn't work!
Obsolete - Prevents a developer from using this property.
If the developer tries to use this property in the code-behind
and compile it. The message is supposed to display in the
task list as an error.
"This property isn't supported."...This doesn't work!
<Browsable(False), _
EditorBrowsable(EditorBrowsableState.Never), _
Obsolete("This property isn't supported.", True)> _
Public Overrides Property BackColor() As Color
Get
Return Nothing
End Get
Set(ByVal Value As Color)
txtBox.BackColor = Nothing
End Set
End Property
End Class
Any ideas why???
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|