Upgrade codes from VB6 to VB.NET on MSDN KB 
Author Message
 Upgrade codes from VB6 to VB.NET on MSDN KB

Hi,

I rewrote part of the code of q147887 in VB.NET and you may kindly check it.
(Suppose the textbox is named Textbox1 and the button is named Button1.)

Imports System
Imports System.Runtime.InteropServices
Public Class Form1
    Inherits System.Windows.Forms.Form
    Const EM_LINESCROLL = &HB6

    <DllImport("user32.dll")> _
    Private Shared Function SendMessage( _
        ByVal hWnd As IntPtr, _
        ByVal wMsg As Int32, _
        ByVal wParam As Int32, _
        ByVal lParam As Int32) _
        As Int32
    End Function
    ' Windows Form Designer generated code is omited
    . . . . . .
    . . . . . .
    . . . . . .

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
        Dim lRet As Integer
        lRet = SendMessage(TextBox1.Handle, EM_LINESCROLL, 0, 5)
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
        Dim intLineIndex As Integer
        Dim intWordIndex As Integer

        TextBox1.Text = ""
        For intLineIndex = 1 To 25
            TextBox1.Text = TextBox1.Text & "Line" & Str(intLineIndex)
            For intWordIndex = 1 To 10
                TextBox1.Text = TextBox1.Text & " Word" & Str(intWordIndex)
            Next intWordIndex
            TextBox1.Text = TextBox1.Text & vbCrLf
        Next intLineIndex
        Button1.Text = "Vertical"
    End Sub
End Class

Regards,
Elan Zhou
This posting is provided "AS IS" with no warranties, and confers no rights.
Got .Net?   http://www.*-*-*.com/



Sun, 30 Jan 2005 13:55:19 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. ANN: VB6 to VB.NET Upgrade Samples

2. HLP: VB6 upgrading to VB.net (a plea)

3. vb6 -> vb.net upgrade problem

4. .NET VB Wizard hangs upgrading VB6 project

5. error in upgrading VB6 DLL to VB.net

6. Upgrade from VB6 to VB.net

7. Custom Upgrading from VB6->VB.NET

8. Upgrade question re: VB6 to VB.Net

9. MSDN for VB6 & .NET

10. Upgrade from Visual Basic 6 webclasses to VB.NET/ASP.NET

11. debugging vb.net upgraded component in asp.net

12. VB.Net HowTo articles for the KB

 

 
Powered by phpBB® Forum Software