VB.NET InputPanel自动滚动后期绑定问题 [英] VB.NET InputPanel AutoScrolling Late Binding Problem

查看:77
本文介绍了VB.NET InputPanel自动滚动后期绑定问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VB.NET InputPanel自动滚动后期绑定问题

我正在将VB.Net 2008 Compact Framework 3.5项目从Windows Mobile 5升级到Windows Mobile6.

该代码在WM 5中有效:

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:

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




在WM 6中使用相同的代码时,出现如下错误消息:

.NET Compact Framework的目标版本不支持后期绑定.

为什么会发生这种情况,我该如何解决?

谢谢




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

推荐答案

我知道了这个


我加了:

Private tbPge As TabPage

放在里面:

Public Class Form2

然后重新编写代码,如下所示:

I figured this out


I added:

Private tbPge As TabPage

Placed it just inside:

Public Class Form2

Then rewrote the code as follows:

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.


这篇关于VB.NET InputPanel自动滚动后期绑定问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆