Results for "Author: 10tec company"
The code uses subclassing technique to trap the WM_MOUSEMOVE event of the Header control which is a constituent part of the ListView control. The handler for this event determines the index of the column header under the mouse pointer and changes the tooltip text respectively; it uses the HDM_HITTEST message for this purpose. To find the handle of the Header control inside ListView from MSCOMCTL.OCX, the code uses the FindWindowEx function which searches for the child window with the "msvb_lib_header" class inside the ListView control.
The attached code demonstrates an idea you can use to create real Win32 tooltips for windowless controls. The problem with Win32 tooltips is that you can attach it only to a control that provides the hwnd property returning the Win32 handle of the control. Some VB intrinsic controls such as Label do not have the hwnd property. The following trick allows you to create real Windows tooltips for these controls. To do it, simply determine the moment when the mouse pointer has entered the area occupied by the required control, and create a tooltip for the FORM that contains the control. You need to detach the created tooltip from the form when the mouse pointer has left the control area; you can do it in the Form_MouseMove method. The attached example shows how to create a multiline balloon tooltip for a Label control. Using this technique, you can create tooltips for any control that implements the MouseMove event (for instance, for Image control too).
A utility class for adding/hiding the horizontal scroll bar in the ListBox control dynamically taking into account its font (using the IFont interface). The code uses the SendMessage API function to add a horizontal scroll bar dynamically to a list box using the LB_SETHORIZONTALEXTENT message. To precisely calculate the width of a new item, our class uses the DrawText API function with the DT_CALCRECT flag. Draw attention at the fact that our class works properly if you change the font of the listbox as you want. We use the IFont interface and its hFont property to retrieve the handle of the font used in the listbox. Our class can also calculate the minimum width of the list box when the horizontal scroll bar disappears (it takes into account the visibility of the vertical scroll bar in the listbox; it determines whether this scroll bar is present by retrieving the listbox style flags and testing these set of flags for WS_VSCROLL).
The attached code demonstrates a technique you can use to create multiline balloon tooltips for ListView items. The code is based on the following simple idea. In the MouseMove event you need to check the index of the item under the mouse pointer, and if this item is changed, you simply redefine the text of the tooltip attached to the ListView control. Notice that you should destroy the tooltip if there is no any item under the mouse pointer. To determine the index of the list-view item under the mouse pointer, we send the LVM_HITTEST message to the ListView control. The SendMessage function you should use to send this message returns the index of the item at the specified position, if any, or -1 otherwise. Before you send the message, populate the pt field of an instance of the LVHITTESTINFO structure with the coordinates of the mouse pointer (you pass the reference to this structure as the value of the lParam parameter in SendMessage). You can use for this purpose the X and Y parameters of the MouseMove event of the control, but draw attention at the fact that these parameters can be measured in twips and you need to convert them in pixels. This simple idea can be used to create such tooltips for ListBox items, any grid control items and so on. For instance, we use this technique in extra samples for iGrid ActiveX Control we produce (this is an editable replacement for ListView and FlexGrid – visit www.10Tec.com for more info).
Advanced VB grid that can emulate the Outlook messages list, edit its cells using built-in editors (textbox,combo,checkbox), supports virtual mode and allows sophisticated displays to be set up. Demos and support files can be found at http://www.10Tec.com/
The code uses subclassing technique to trap the WM_MOUSEMOVE event of the Header control which is a constituent part of the ListView control. The handler for this event determines the index of the column header under the mouse pointer and changes the tooltip text respectively; it uses the HDM_HITTEST message for this purpose. To find the handle of the Header control inside ListView from MSCOMCTL.OCX, the code uses the FindWindowEx function which searches for the child window with the "msvb_lib_header" class inside the ListView control.
The attached code demonstrates an idea you can use to create real Win32 tooltips for windowless controls. The problem with Win32 tooltips is that you can attach it only to a control that provides the hwnd property returning the Win32 handle of the control. Some VB intrinsic controls such as Label do not have the hwnd property. The following trick allows you to create real Windows tooltips for these controls. To do it, simply determine the moment when the mouse pointer has entered the area occupied by the required control, and create a tooltip for the FORM that contains the control. You need to detach the created tooltip from the form when the mouse pointer has left the control area; you can do it in the Form_MouseMove method. The attached example shows how to create a multiline balloon tooltip for a Label control. Using this technique, you can create tooltips for any control that implements the MouseMove event (for instance, for Image control too).
A utility class for adding/hiding the horizontal scroll bar in the ListBox control dynamically taking into account its font (using the IFont interface). The code uses the SendMessage API function to add a horizontal scroll bar dynamically to a list box using the LB_SETHORIZONTALEXTENT message. To precisely calculate the width of a new item, our class uses the DrawText API function with the DT_CALCRECT flag. Draw attention at the fact that our class works properly if you change the font of the listbox as you want. We use the IFont interface and its hFont property to retrieve the handle of the font used in the listbox. Our class can also calculate the minimum width of the list box when the horizontal scroll bar disappears (it takes into account the visibility of the vertical scroll bar in the listbox; it determines whether this scroll bar is present by retrieving the listbox style flags and testing these set of flags for WS_VSCROLL).
The attached code demonstrates a technique you can use to create multiline balloon tooltips for ListView items. The code is based on the following simple idea. In the MouseMove event you need to check the index of the item under the mouse pointer, and if this item is changed, you simply redefine the text of the tooltip attached to the ListView control. Notice that you should destroy the tooltip if there is no any item under the mouse pointer. To determine the index of the list-view item under the mouse pointer, we send the LVM_HITTEST message to the ListView control. The SendMessage function you should use to send this message returns the index of the item at the specified position, if any, or -1 otherwise. Before you send the message, populate the pt field of an instance of the LVHITTESTINFO structure with the coordinates of the mouse pointer (you pass the reference to this structure as the value of the lParam parameter in SendMessage). You can use for this purpose the X and Y parameters of the MouseMove event of the control, but draw attention at the fact that these parameters can be measured in twips and you need to convert them in pixels. This simple idea can be used to create such tooltips for ListBox items, any grid control items and so on. For instance, we use this technique in extra samples for iGrid ActiveX Control we produce (this is an editable replacement for ListView and FlexGrid – visit www.10Tec.com for more info).
Advanced VB grid that can emulate the Outlook messages list, edit its cells using built-in editors (textbox,combo,checkbox), supports virtual mode and allows sophisticated displays to be set up. Demos and support files can be found at http://www.10Tec.com/
The code uses subclassing technique to trap the WM_MOUSEMOVE event of the Header control which is a constituent part of the ListView control. The handler for this event determines the index of the column header under the mouse pointer and changes the tooltip text respectively; it uses the HDM_HITTEST message for this purpose. To find the handle of the Header control inside ListView from MSCOMCTL.OCX, the code uses the FindWindowEx function which searches for the child window with the "msvb_lib_header" class inside the ListView control.
Advanced VB grid that can emulate the Outlook messages list, edit its cells using built-in editors (textbox,combo,checkbox), supports virtual mode and allows sophisticated displays to be set up. Demos and support files can be found at http://www.10Tec.com/
A utility class for adding/hiding the horizontal scroll bar in the ListBox control dynamically taking into account its font (using the IFont interface). The code uses the SendMessage API function to add a horizontal scroll bar dynamically to a list box using the LB_SETHORIZONTALEXTENT message. To precisely calculate the width of a new item, our class uses the DrawText API function with the DT_CALCRECT flag. Draw attention at the fact that our class works properly if you change the font of the listbox as you want. We use the IFont interface and its hFont property to retrieve the handle of the font used in the listbox. Our class can also calculate the minimum width of the list box when the horizontal scroll bar disappears (it takes into account the visibility of the vertical scroll bar in the listbox; it determines whether this scroll bar is present by retrieving the listbox style flags and testing these set of flags for WS_VSCROLL).
The attached code demonstrates a technique you can use to create multiline balloon tooltips for ListView items. The code is based on the following simple idea. In the MouseMove event you need to check the index of the item under the mouse pointer, and if this item is changed, you simply redefine the text of the tooltip attached to the ListView control. Notice that you should destroy the tooltip if there is no any item under the mouse pointer. To determine the index of the list-view item under the mouse pointer, we send the LVM_HITTEST message to the ListView control. The SendMessage function you should use to send this message returns the index of the item at the specified position, if any, or -1 otherwise. Before you send the message, populate the pt field of an instance of the LVHITTESTINFO structure with the coordinates of the mouse pointer (you pass the reference to this structure as the value of the lParam parameter in SendMessage). You can use for this purpose the X and Y parameters of the MouseMove event of the control, but draw attention at the fact that these parameters can be measured in twips and you need to convert them in pixels. This simple idea can be used to create such tooltips for ListBox items, any grid control items and so on. For instance, we use this technique in extra samples for iGrid ActiveX Control we produce (this is an editable replacement for ListView and FlexGrid – visit www.10Tec.com for more info).
The attached code demonstrates an idea you can use to create real Win32 tooltips for windowless controls. The problem with Win32 tooltips is that you can attach it only to a control that provides the hwnd property returning the Win32 handle of the control. Some VB intrinsic controls such as Label do not have the hwnd property. The following trick allows you to create real Windows tooltips for these controls. To do it, simply determine the moment when the mouse pointer has entered the area occupied by the required control, and create a tooltip for the FORM that contains the control. You need to detach the created tooltip from the form when the mouse pointer has left the control area; you can do it in the Form_MouseMove method. The attached example shows how to create a multiline balloon tooltip for a Label control. Using this technique, you can create tooltips for any control that implements the MouseMove event (for instance, for Image control too).
The code uses subclassing technique to trap the WM_MOUSEMOVE event of the Header control which is a constituent part of the ListView control. The handler for this event determines the index of the column header under the mouse pointer and changes the tooltip text respectively; it uses the HDM_HITTEST message for this purpose. To find the handle of the Header control inside ListView from MSCOMCTL.OCX, the code uses the FindWindowEx function which searches for the child window with the "msvb_lib_header" class inside the ListView control.
Advanced VB grid that can emulate the Outlook messages list, edit its cells using built-in editors (textbox,combo,checkbox), supports virtual mode and allows sophisticated displays to be set up. Demos and support files can be found at http://www.10Tec.com/
A utility class for adding/hiding the horizontal scroll bar in the ListBox control dynamically taking into account its font (using the IFont interface). The code uses the SendMessage API function to add a horizontal scroll bar dynamically to a list box using the LB_SETHORIZONTALEXTENT message. To precisely calculate the width of a new item, our class uses the DrawText API function with the DT_CALCRECT flag. Draw attention at the fact that our class works properly if you change the font of the listbox as you want. We use the IFont interface and its hFont property to retrieve the handle of the font used in the listbox. Our class can also calculate the minimum width of the list box when the horizontal scroll bar disappears (it takes into account the visibility of the vertical scroll bar in the listbox; it determines whether this scroll bar is present by retrieving the listbox style flags and testing these set of flags for WS_VSCROLL).
The attached code demonstrates a technique you can use to create multiline balloon tooltips for ListView items. The code is based on the following simple idea. In the MouseMove event you need to check the index of the item under the mouse pointer, and if this item is changed, you simply redefine the text of the tooltip attached to the ListView control. Notice that you should destroy the tooltip if there is no any item under the mouse pointer. To determine the index of the list-view item under the mouse pointer, we send the LVM_HITTEST message to the ListView control. The SendMessage function you should use to send this message returns the index of the item at the specified position, if any, or -1 otherwise. Before you send the message, populate the pt field of an instance of the LVHITTESTINFO structure with the coordinates of the mouse pointer (you pass the reference to this structure as the value of the lParam parameter in SendMessage). You can use for this purpose the X and Y parameters of the MouseMove event of the control, but draw attention at the fact that these parameters can be measured in twips and you need to convert them in pixels. This simple idea can be used to create such tooltips for ListBox items, any grid control items and so on. For instance, we use this technique in extra samples for iGrid ActiveX Control we produce (this is an editable replacement for ListView and FlexGrid – visit www.10Tec.com for more info).
The attached code demonstrates an idea you can use to create real Win32 tooltips for windowless controls. The problem with Win32 tooltips is that you can attach it only to a control that provides the hwnd property returning the Win32 handle of the control. Some VB intrinsic controls such as Label do not have the hwnd property. The following trick allows you to create real Windows tooltips for these controls. To do it, simply determine the moment when the mouse pointer has entered the area occupied by the required control, and create a tooltip for the FORM that contains the control. You need to detach the created tooltip from the form when the mouse pointer has left the control area; you can do it in the Form_MouseMove method. The attached example shows how to create a multiline balloon tooltip for a Label control. Using this technique, you can create tooltips for any control that implements the MouseMove event (for instance, for Image control too).