Jump to content
  • Advertisement
Sign in to follow this  
bobmango

visual basic question

This topic is 4976 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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!