当前位置: 代码迷 >> PB >> 问个有关问题,dw中有一列数据很长,如果让设置成自动行高很影响版面美观,小弟我想实现用鼠标只上去就想tooltip一样显示其全部内容,可以实现吗
  详细解决方案

问个有关问题,dw中有一列数据很长,如果让设置成自动行高很影响版面美观,小弟我想实现用鼠标只上去就想tooltip一样显示其全部内容,可以实现吗

热度:70   发布时间:2016-04-29 10:11:32.0
问个问题,dw中有一列数据很长,如果让设置成自动行高很影响版面美观,我想实现用鼠标只上去就想tooltip一样显示其全部内容,可以实现吗?
先谢过了^_^

------解决方案--------------------
VB.NET code
//================================================================================// Script - ue_display_column for u_dw_base // Reason: 显示列值//--------------------------------------------// Modified By: qin_phoenix        Date: 2009.10.15//--------------------------------------------////================================================================================If ii_DwId = 0 Then Return 0if lb_set_column_display then         if lower(dwo.type) = 'column' then                 Integer li_X, li_Y         String ls_Text                                                //根据数据窗口列的位置和名称设置ToolTip控件            If dwo.Type = "column" Then                            If String( dwo.Name ) <> is_ColName Then                                         li_X = UnitsToPixels( Integer( dwo.X ),XUnitsToPixels! )                    li_Y = UnitsToPixels( Integer( dwo.Y ), YUnitsToPixels! )                                        //更新ToolTip控件窗口                    inv_ToolTip.of_UpdatetipRect( This, ii_dwID, li_X, li_Y, &                                    li_X + UnitsToPixels( Integer( dwo.Width ), XUnitsToPixels! ), &                                            li_Y + UnitsToPixels( Integer( dwo.Height ), YUnitsToPixels! ) )                                    //引用各列的列名作为提示文本                    is_ColName = String( dwo.Name )                    ls_Text = This.Describe( is_ColName + "_t.Text" )                    inv_ToolTip.of_settiptext( This, ii_dwID, "请输入" + ls_Text )    End IfEnd IfReturn 0            end if                end if
------解决方案--------------------
主要是要解决在mousemove 事件中如何获取到该行的数据。
用行高和xpos 计算鼠标所在行试试。
------解决方案--------------------
pb9的tooltip
forward
global type nvo_tooltips from nonvisualobject
end type
type point from structure within nvo_tooltips
end type
type msg from structure within nvo_tooltips
end type
type rect from structure within nvo_tooltips
end type
type toolinfo from structure within nvo_tooltips
end type
end forward

type point from structure
long x
long y
end type

type msg from structure
long hwnd
long message
long wparam
long lparam
long time
point pt
end type

type rect from structure
long left
long top
long right
long bottom
end type

type toolinfo from structure
long cbsize
long uflags
long hwnd
long uid
rect rect
long hinstance
long lpsztext
end type

global type nvo_tooltips from nonvisualobject autoinstantiate
end type

type prototypes
SubRoutine InitCommonControls() library "comctl32.dll"
Function long CreateWindowExA(ulong dwExStyle, string ClassName, &
long WindowName, ulong dwStyle, ulong X, ulong Y, ulong nWidth, &
ulong nHeight, ulong hWndParent, ulong hMenu, ulong hInstance, &
ulong lpParam) library "user32.dll"
Function integer DestroyWindow(long hWnd) library "user32.dll"
Function integer ToolTipMsg(long hWnd, long uMsg, long wParam, &
REF TOOLINFO ToolInfo) library "user32.dll" Alias For "SendMessageA"
Function integer RelayMsg(long hWnd, long uMsg, long wParam, &
REF MSG Msg) library "user32.dll" Alias For "SendMessageA"

Function long LocalAlloc(long Flags, long Bytes) library "kernel32.dll"
Function long LocalFree(long MemHandle) library "kernel32.dll"
  相关解决方案