Click here to Skip to main content
15,892,059 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
VB.NET InputPanel AutoScrolling Late Binding Problem

I am upgrading a VB.Net 2008 Compact Framework 3.5 project from Windows Mobile 5 to Windows Mobile 6.

This code worked in WM 5:

VB
If InputPanel1.Enabled = False Then
            For Each tbPge In tabCollect.TabPages
                tbPge.AutoScroll = False 'error fires on this line see details below
            Next

            tabCollect.Height = 268
            tabCollect.Width = 240
End If



When I use the same code in WM 6 I get an error message as follows:

The targeted version of the .NET Compact Framework does not support latebinding.

Why is this happening and how do I fix it?

Thanks
Posted
Updated 15-Feb-12 8:20am
v2

1 solution

I figured this out


I added:

Private tbPge As TabPage

Placed it just inside:

Public Class Form2

Then rewrote the code as follows:

VB
Private Sub InputPanel1_EnabledChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles InputPanel1.EnabledChanged
        If InputPanel1.Enabled = False Then
            For Each Me.tbPge In tabCollect.TabPages
                tbPge.AutoScroll = False
            Next

            tabCollect.Height = 268
            tabCollect.Width = 240
        Else
            ' The SIP is enabled, so the height of the tab control 
            ' is set to the height of the visible desktop area.
            For Each Me.tbPge In tabCollect.TabPages
                tbPge.AutoScroll = True
                tbPge.AutoScrollMargin = New Size(5, 5)
                Dim ctrl As Control
                For Each ctrl In tbPge.Controls
                    If TypeOf ctrl Is TextBox Then
                        If ctrl.Focused = True Then
                            Dim intpos As Integer
                            intpos = ctrl.Location.Y
                            tbPge.AutoScrollPosition = New Point(0, intpos - tbPge.AutoScrollPosition.Y)
                        End If
                    End If
                Next
            Next

            tabCollect.Height = InputPanel1.VisibleDesktop.Height
            tabCollect.Width = InputPanel1.VisibleDesktop.Width
        End If
    End Sub

That works and I am back in business.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900