Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
AutoComplete - Infralogistics
Message
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
VB 8.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01242788
Message ID:
01242985
Views:
23
> '[DefaultValue(typeof(AutoCompleteSource), "ListItems")]

That simply specifies the Default values that show up in the Property Sheet for the Property and specifies that it is of the type, AutoCompleteSource (which is an Enum in this case).

I'm sorry ... I got super busy after I posted that, then I had a few meetings. So I didn't see your post about converting to VB until just now. You need to look the online code converters. There are several of them, but this one works pretty good:

http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx

It shows this conversion:
<DefaultValue(GetType(ComboBoxStyle), "DropDown")> _
Public Shadows Property DropDownStyle() As ComboBoxStyle
	Get
		Return MyBase.DropDownStyle
	End Get
	Set
		MyBase.DropDownStyle = value
	End Set
End Property
~~Bonnie



>this is what I have so far, please review the code that is in comment, I dont know how to convert.
>
>Public Class ComboBoxEx
>    Inherits System.Windows.Forms.ComboBox
>    Private mclrDropDownStyle As ComboBoxStyle
>    Private mclrAutoCompleteMode As AutoCompleteMode
>    Private mclrAutoCompleteSource As AutoCompleteSource
>
>
>#Region "Declarations"
>
>    Private InEditMode As Boolean = True
>
>#End Region
>
>#Region "Constructor"
>
>    Public Sub ComboBoxEx()
>
>        Me.DropDownStyle = ComboBoxStyle.DropDown
>        Me.AutoCompleteMode = AutoCompleteMode.SuggestAppend
>        Me.AutoCompleteSource = AutoCompleteSource.ListItems
>    End Sub
>
>
>#End Region
>
>#Region "Properties"
>
>    Public Overloads Property DropDownStyle() As ComboBoxStyle
>
>        Get
>            Return DropDownStyle
>        End Get
>        Set(ByVal Value As ComboBoxStyle)
>            mclrDropDownStyle = Value
>        End Set
>    End Property
>
>    'DefaultValue(typeof(AutoCompleteMode), "SuggestAppend")
>    Public Overloads Property AutoCompleteMode() As AutoCompleteMode
>
>        Get
>            Return AutoCompleteMode
>        End Get
>        Set(ByVal Value As AutoCompleteMode)
>            mclrAutoCompleteMode = Value
>        End Set
>
>    End Property
>
>    '[DefaultValue(typeof(AutoCompleteSource), "ListItems")]
>    Public Overloads Property AutoCompleteSource() As AutoCompleteSource
>
>        Get
>            Return AutoCompleteSource
>        End Get
>
>        Set(ByVal value As AutoCompleteSource)
>
>            mclrAutoCompleteSource = value
>        End Set
>
>    End Property
>
>#End Region
>
>#Region "Events"
>
>    Protected Overrides Sub OnBindingContextChanged(ByVal e As EventArgs)
>
>        Me.DropDownStyle = ComboBoxStyle.DropDown
>        MyBase.OnBindingContextChanged(e)
>    End Sub
>
>    Protected Shadows Sub OnValidating(ByVal e As System.ComponentModel.CancelEventArgs)
>
>
>        Dim index = FindStringExact(Text)
>
>        If (index >= 0) Then
>            MyBase.OnValidating(e)
>        Else
>            If (Text.Trim() = "") Then
>
>                ' do nothing
>
>            Else
>
>                e.Cancel = True
>            End If
>        End If
>
>    End Sub
>
>
>    Protected Overrides Sub OnKeyDown(ByVal e As KeyEventArgs)
>
>        Me.InEditMode = (e.KeyCode <> Keys.Back And e.KeyCode <> Keys.Delete)
>        MyBase.OnKeyDown(e)
>    End Sub
>    Protected Overrides Sub OnTextChanged(ByVal e As EventArgs)
>
>        If (Me.InEditMode) Then
>
>            Dim index = Me.FindString(Me.Text)
>
>            If (index < 0 And Text.Trim() <> "") Then
>
>                InEditMode = False
>                Me.Text = Text.Substring(0, Text.Length - 1)
>                Me.InEditMode = True
>            End If
>        End If
>
>        Select Case (Me.Text.Length)
>
>        End Select
>        MyBase.OnTextChanged(e)
>    End Sub
>
>#End Region
>
>End Class
>
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform