Sign in to follow this  

visual basic question

This topic is 4666 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

ive been looking around at visual basic to buy lately and im used to using visual basic 6 in school and on amazon i found visual basic .NET just curious if its the same thing just with a couple add-ons for websites and such? thanks

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I believe you can still compile vb6 code in vb.NET. I also believe that .NET is much more than "just a couple of web site add-ons"

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
I believe you can still compile vb6 code in vb.NET. I also believe that .NET is much more than "just a couple of web site add-ons"


Yes, .NET is a whole new iteration of the compiler. The language has changed slightly, and is now built on top of the .NET framework, which could be a good thing and a bad thing.

Share this post


Link to post
Share on other sites
Quote:
Original post by Anonymous Poster
I believe you can still compile vb6 code in vb.NET. I also believe that .NET is much more than "just a couple of web site add-ons"


Ummm, no. You can not compile VB6 code in .NET straight forward.

Here's some VB.NET code to show you:

Public Class ComboPlus
Inherits System.Windows.Forms.ComboBox

Dim doIt As Boolean = False
Dim mAutoFill As Boolean = True
Dim mEnterByTab As Boolean = True

Event NotFounded(ByVal PalabraNoEncontrada As String)

Property EnterByTab() As Boolean
Get
Return mEnterByTab
End Get
Set(ByVal Value As Boolean)
mEnterByTab = Value
End Set
End Property

Property AutoFill() As Boolean
Get
Return mAutoFill
End Get
Set(ByVal Value As Boolean)
mAutoFill = Value
End Set
End Property

Protected Overrides Sub OnKeyDown(ByVal e As System.Windows.Forms.KeyEventArgs)
Dim Index As Integer

If mAutoFill AndAlso (e.KeyCode = Keys.Enter OrElse e.KeyCode = Keys.Back OrElse e.KeyCode = Keys.Delete) Then
doIt = False
Else
doIt = True
End If
If e.KeyCode = Keys.Enter Then
If Me.FindString(Me.Text) = -1 Then
RaiseEvent NotFounded(Me.Text)
ElseIf mEnterByTab Then
Me.Select(0, 0)
e.Handled = True
SendKeys.Send("{TAB}")
End If
Else
e.Handled = False
MyBase.OnKeyDown(e)
End If
End Sub

Protected Overrides Sub OnTextChanged(ByVal e As System.EventArgs)
Dim Starts, Index As Integer
If mAutoFill AndAlso doIt Then
Index = Me.FindString(Me.Text)
If Index >= 0 Then
Starts = Me.Text.Length
doIt = False
If Me.DisplayMember = "" Then
Me.Text = Me.Items.Item(Index).ToString
Me.Select(Starts, Me.Items.Item(Index).ToString.Length - Starts)
Else
Me.Text = Me.Items.Item(Index).item(Me.DisplayMember)
Me.Select(Starts, Me.Items.Item(Index).item(Me.DisplayMember).Length - Starts)
End If
doIt = True
End If
End If
MyBase.OnTextChanged(e)
End Sub

Protected Overrides Sub OnKeyPress(ByVal e As System.Windows.Forms.KeyPressEventArgs)
If e.KeyChar = ChrW(13) Then
e.Handled = True
Else
MyBase.OnKeyPress(e)
End If
End Sub
End Class


Share this post


Link to post
Share on other sites

This topic is 4666 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this