- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我正在以连续的形式实现拖放模拟。
基本上它的工作方式是,旁边有一个人列表,用户可以将一个人从列表拖到一个字段,(这是一个座位列表,有 Seat1,Seat2,seat3 等字段...... ,每一排座位都是一条新记录)。
对于基本的拖放功能,我正在使用此链接 Drag And Drop 中的说明,而且效果很好。
现在这是我的问题,要知道用户在哪条记录上移动鼠标,我需要计算鼠标的位置除以详细信息部分,这样当表单没有向下滚动时它运行良好,但是当表单向下滚动时,我需要首先知道表单向下滚动了多少,这只能通过 Windows API 来完成。
所以我发现 www.lebans.com/conformscurcontrol.htm 有我需要的代码,但它只在旧版本的 ms access 中有效,在新版本中中断的代码是,他正在检查一个窗口类名称“scrollbar”并在其上调用 GetScrollInfo API,但在较新的版本中没有名为“scrollbar”的类,但有一个名为 NUIScrollbar 的类 See Here ,但即使将其更改为此名称,我也不会返回有效的滚动条类 (LPSCROLLINFO)。
这是 Stephen Lebans 的代码
Public Function fGetScrollBarPos(frm As Form) As Long
' Return ScrollBar Thumb position
' for the Vertical Scrollbar attached to the
' Form passed to this Function.
Dim hWndSB As Long
Dim lngRet As Long
Dim sinfo As SCROLLINFO
' Init SCROLLINFO structure
sinfo.fMask = SIF_ALL
sinfo.cbSize = Len(sinfo)
sinfo.nPos = 0
sinfo.nTrackPos = 0
' Call function to get handle to
' ScrollBar control if it is visible
hWndSB = fIsScrollBar(frm)
If hWndSB = -1 Then
fGetScrollBarPos = False
Exit Function
End If
' Get the window's ScrollBar position
lngRet = apiGetScrollInfo(hWndSB, SB_CTL, sinfo)
'Debug.Print "nPos:" & sInfo.nPos & " nPage:" & sInfo.nPage & " nMax:" & sInfo.nMax
fGetScrollBarPos = sinfo.nPos + 1
End Function
Private Function fIsScrollBar(frm As Form) As Long
' Get ScrollBar's hWnd
Dim hWnd_VSB As Long
Dim hWnd As Long
hWnd = frm.hWnd
' Let's get first Child Window of the FORM
hWnd_VSB = apiGetWindow(hWnd, GW_CHILD)
' Let's walk through every sibling window of the Form
Do
' Thanks to Terry Kreft for explaining
' why the apiGetParent acll is not required.
' Terry is in a Class by himself! :-)
'If apiGetParent(hWnd_VSB) <> hWnd Then Exit Do
这是古老的和平
If fGetClassName(hWnd_VSB) = "scrollBar" Then
If apiGetWindowLong(hWnd_VSB, GWL_STYLE) And SBS_VERT Then
fIsScrollBar = hWnd_VSB
Exit Function
End If
End If
这就是我尝试替换它的方式
If fGetClassName(hWnd_VSB) = "NUIScrollbar" Then
If apiGetWindowLong(hWnd_VSB, GWL_STYLE) And 1107296256 Then
fIsScrollBar = hWnd_VSB
Exit Function
End If
End If
继续函数
' Let's get the NEXT SIBLING Window
hWnd_VSB = apiGetWindow(hWnd_VSB, GW_HWNDNEXT)
' Let's Start the process from the Top again
' Really just an error check
Loop While hWnd_VSB <> 0
' SORRY - NO Vertical ScrollBar control
' is currently visible for this Form
fIsScrollBar = -1
End Function
' From Dev Ashish's Site
' The Access Web
' http://www.mvps.org/access/
'******* Code Start *********
Private Function fGetClassName(hWnd As Long)
Dim strBuffer As String
Dim lngLen As Long
Const MAX_LEN = 255
strBuffer = Space$(MAX_LEN)
lngLen = apiGetClassName(hWnd, strBuffer, MAX_LEN)
If lngLen > 0 Then fGetClassName = Left$(strBuffer, lngLen)
End Function
'******* Code End *********
希望我说得够清楚,感谢任何帮助。
最佳答案
遇到同样的问题,以下似乎有效:
Public Const SB_HORZ As Long = 0 ' &H0 (32 bit)
Public Const SB_VERT As Long = 1 ' &H1 (32 bit)
Public Const SB_CTL As Long = 2
Public Const SB_BOTH As Long = 3
Public Const SB_HORZ64_0 As Long = 1107296256 ' &H42000000 (64 bit - invisible)
Public Const SB_VERT64_0 As Long = 1107296257 ' &H42000001 (64 bit - invisible)
Public Const SB_HORZ64_1 As Long = 1375731712 ' &H52000000 (64 bit - visible)
Public Const SB_VERT64_1 As Long = 1375731713 ' &H52000001 (64 bit - visible)
...
eWindowStyle = GetWindowLong(ehWnd, GWL_STYLE)
Select Case eWindowStyle
Case SB_HORZ, SB_HORZ64_0, SB_HORZ64_1
' *** Horizontal
wWinAPIhWndScrollbarHorz = ehWnd
Case SB_VERT, SB_VERT64_0, SB_VERT64_1
' *** Vertikal
wWinAPIhWndScrollbarVert = ehWnd
End Select
...
关于vba - 以连续形式控制 ms Access 滚动条,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39298361/
这是一个新手理论问题 - 我刚刚开始使用 Python 并研究 Django 和 orm。问题:如果我开发我的对象并通过额外的开发修改基础对象结构、继承等 - Django 的 ORM 解决方案会自动
我正在使用带有服务器端处理器的 JavaScript 表单,并且我希望能够让表单根据下拉列表转到不同的电子邮件。我已经根据其他表格尽了最大努力,但似乎无法通过电子邮件。我已在电子邮件地址的选项标签下添
一个简单的问题:给定定义,(来自 Haskell SOE) do x — el; el\ ...; en => el »= \x — do e2\ ...; en 和: do let d
我是 Angular 5 的新手。我目前正在研究 Angular Reactive 表单。我有一个下面的 JSON 结构,我需要在从 FORM 获取值后发回 REST API。 JSON 结构: {
我是 Angular 5 的新手。我目前正在研究 Angular Reactive 表单。我有一个下面的 JSON 结构,我需要在从 FORM 获取值后发回 REST API。 JSON 结构: {
我有一个类型(称之为 A),我想创建一个 A -> A、A -> A -> A、A -> A -> A -> ... 等类型的函数的类型类.这不起作用: {-# LANGUAGE FlexibleIn
我正在使用 java 线程同时管理多个 (3) 程序。1 用于 Java swing 表单(绘制 UI 以进行输入),1 用于在系统托盘上设置图标(从 UI 获取输入后立即启动),1 用于处理输入并将
在当前的元素中,我在表单中遇到了一个问题。表单中标签的字体大小可能大于默认值。如果我把它举起来,那么右边的输入必须垂直居中。 我查看了 Bootstrap 和 Foundation,但都没有解决这个问
为了好玩,我使用了一段从 friend 那里得到的代码,并尝试创建一个包含用户名和密码的登录字段,但我很难获得单词旁边的字段。 username 这个词和你输入的框之间有很大的差距。密码也是如此。 这
我的表单中有一个嵌套的控制组,我想访问它们的表单状态值(如原始和有效)以动态显示验证错误。 是这样动态构建的 controlMap['password'] = this.password; contr
发送后我试图重置我的表单,但只有值设置为空。 component.html {{note.value?.length || 0}}/10
我正在尝试自定义 Stripe 结帐表单,但我不知道如何添加输入。我想添加“电话号码”和“姓名”以创建费用和客户。你知道我该怎么做吗? 这是我应该自定义的代码。 最佳答案 您将无法使用
所以我有这个需求,我想以表格的形式提交一个由五个记录组成的表单。这就是它的样子表: 这是对应的代码: Section Q.No Question
我有一个使用 react 形式和输入文本的情况。 我需要: 当用户输入时,根据输入的内容建议一个列表(我使用的是 ngx bootstrap typeahead); 仅当用户失去输入焦点时才验证输入字
我希望重构我的 Angular 项目中的大量组件,以具有强类型的 FormGroups、FormArrays 和 FormControls。 我只是在寻找一种实现强类型 react 形式的好方法。任何
我有事件表格: 'horizontal', 'fieldConfig' => [ 'template' => "{input}\n{hint}\n{error}",
是否有关于如何实现多选和响应式表单的示例? 我正在尝试在 multiselect-dropdown 上设置所选项目(从数据库中检索),它会更新显示的项目( View ),但会引发以下错误: core.
我想在表单中添加按钮以动态添加输入。但是我发现,如果我在表单中添加了一个仅记录到控制台的按钮(并且当我尝试添加输入时),它将记录日志,然后表单中断。我的Electron应用程序的前端窗口崩溃(不退出但
我有一个这样的表格 此表单位于指令内: angular.module('crowdcoreApp').directive('investorForm',function(){
我在 angularjs Controller 中调用的 $mdDialog 中有一个表单,如下所示: actions-controller.js function callForm() {
我是一名优秀的程序员,十分优秀!