user controls 
Author Message
 user controls

I just created my first user controls and I am quite
e{*filter*}d to see them working. However, I would like to have
descriptions of the properties appear when the devellopper
clicks on a property in the properties window ( at the
bottom of the property window just like any other standar
property) and when they are selecting the property  from
the drop box ( when you type datagrid1.  you get a set of
values and you can choose from the list and as you go down
the list you get a little message explaining what the
property does)
I am not sure this will make sense to anyone, but if it
does the help would be deeply appreciated.
BTW, how can I cancel a keypress , I assume it is in the
keypress event but I see no way to cancel it there.

Thank you very much

Jonn



Tue, 13 Jul 2004 06:24:24 GMT  
 user controls

Quote:
> I just created my first user controls and I am quite
> e{*filter*}d to see them working. However, I would like to have
> descriptions of the properties appear when the devellopper
> clicks on a property in the properties window ( at the
> bottom of the property window just like any other standar
> property) and when they are selecting the property  from
> the drop box ( when you type datagrid1.  you get a set of
> values and you can choose from the list and as you go down
> the list you get a little message explaining what the
> property does)
> I am not sure this will make sense to anyone, but if it
> does the help would be deeply appreciated.
> BTW, how can I cancel a keypress , I assume it is in the
> keypress event but I see no way to cancel it there.

John,

What you need to do is put an Import statement at the top of your code file
for the System.ComponentModel. Then you will need to use Attributes
(Category, DefaultValue and Description) above your property.

Here is an example for you:

************************************
Imports System.ComponentModel

....

Private m_MyProperty As String

<Browsable(True), _
Category("Your Category Here"), _
DefaultValue(""), _
Description("Indicates a file to use for " + _
"design time puposes if an InputTask is not specified"), _
Public Overridable Property MyProperty() As String
    Get
        Return m_MyProperty
    End Get
    Set(ByVal Value As String)
        m_MyProperty = Value
    End Set
End Property

************************************

Also, there is a more info in the helps file regarding these and many other
Attributes. The best way to search for them is to append the word
"Attribute" to the end of them when searching such as:

"CategoryAttribute"

Typing the full name is optional when using Attributes in code though.

Hope this helps,

Cal



Tue, 13 Jul 2004 07:03:35 GMT  
 user controls

Quote:
> I just created my first user controls and I am quite
> e{*filter*}d to see them working. However, I would like to have
> descriptions of the properties appear when the devellopper
> clicks on a property in the properties window ( at the
> bottom of the property window just like any other standar
> property) and when they are selecting the property  from
> the drop box ( when you type datagrid1.  you get a set of
> values and you can choose from the list and as you go down
> the list you get a little message explaining what the
> property does)
> I am not sure this will make sense to anyone, but if it
> does the help would be deeply appreciated.
> BTW, how can I cancel a keypress , I assume it is in the
> keypress event but I see no way to cancel it there.

John,

One other thing I just now noticed is that you are also wanting the tool
tips on the Intellisense drop down list. At this time, it is only possible
from C# and not from VB.NET.

As for you last question regarding the keypress event, you need to set the
KeyPressEventArgs parameters "Handled" property to True as in the following
code:

Public Class MeTextBox : Inherits TextBox

    Protected Overrides Sub OnKeyPress( _
        ByVal e As System.Windows.Forms.KeyPressEventArgs)

        e.Handled = True

    End Sub

End Class

Once again, hope this helps.

Cal



Tue, 13 Jul 2004 07:09:58 GMT  
 user controls
Thank you very much! this is precious information!

John

Quote:
>-----Original Message-----
>> I just created my first user controls and I am quite
>> e{*filter*}d to see them working. However, I would like to
have
>> descriptions of the properties appear when the
devellopper
>> clicks on a property in the properties window ( at the
>> bottom of the property window just like any other
standar
>> property) and when they are selecting the property  from
>> the drop box ( when you type datagrid1.  you get a set
of
>> values and you can choose from the list and as you go
down
>> the list you get a little message explaining what the
>> property does)
>> I am not sure this will make sense to anyone, but if it
>> does the help would be deeply appreciated.
>> BTW, how can I cancel a keypress , I assume it is in the
>> keypress event but I see no way to cancel it there.

>John,

>What you need to do is put an Import statement at the top
of your code file
>for the System.ComponentModel. Then you will need to use
Attributes
>(Category, DefaultValue and Description) above your
property.

>Here is an example for you:

>************************************
>Imports System.ComponentModel

>.....

>Private m_MyProperty As String

><Browsable(True), _
>Category("Your Category Here"), _
>DefaultValue(""), _
>Description("Indicates a file to use for " + _
>"design time puposes if an InputTask is not specified"), _
>Public Overridable Property MyProperty() As String
>    Get
>        Return m_MyProperty
>    End Get
>    Set(ByVal Value As String)
>        m_MyProperty = Value
>    End Set
>End Property

>************************************

>Also, there is a more info in the helps file regarding

these and many other

- Show quoted text -

Quote:
>Attributes. The best way to search for them is to append
the word
>"Attribute" to the end of them when searching such as:

>"CategoryAttribute"

>Typing the full name is optional when using Attributes in
code though.

>Hope this helps,

>Cal

>.



Tue, 13 Jul 2004 07:34:21 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. User Control in User Control

2. Keypreview Lost When Using a User Control embedded in another user control

3. User Control and User Defined Type Passing

4. User Control - User-defined type not defined

5. user controls and custom controls

6. getting run-time behavior of a contained control in a user control at design time

7. Accessing Host control properies from User Control

8. Licensing 3rd party controls in a User Control

9. Using ADO Data Control on User Control as Data Source

10. Creating Custom Controls in VBNet (not User Control, AFAIK)

11. Create a Custom Control (not a User Control, AFAIK)

12. Problems with ADO Data Control in User Controls

 

 
Powered by phpBB® Forum Software