Samir
Mon Oct 30 04:09:35 CST 2006
Thx all for the answes, actually it is my mistake not to determine that i am
using Listview not VFP Grid.
I have found a trick on VB site, that you can make the Listview auto width
adjustment. i convert it to vfp code and it works perfectly although i
didnot understand how it works, Who cares :)
DECLARE INTEGER SendMessage IN user32;
INTEGER hWnd,;
INTEGER Msg,;
INTEGER wParam,;
INTEGER lParam
SET_COLUMN_WIDTH = 4126
AUTOSIZE_USEHEADER = -1 && this will make the listview autofit with
longest data in listview whixh has the same effect of sending CTRL and +
* AUTOSIZE_USEHEADER = -2 && this will make the listview autofit with the
header size
lnListViewCC = thisform.olistview.ColumnHeaders.Count
ctrlHwnd = Thisform.oListview.hWnd
FOR I = 0 TO lnListViewCC - 1
= SendMessage(Thisform.oListview.hWnd , SET_COLUMN_WIDTH,
I,@AUTOSIZE_USEHEADER)
NEXT I
Samir Ibrahim
"Samir Ibrahim" <samir.ibrahim@wilcopm.com> wrote in message
news:eTXTgnn%23GHA.4356@TK2MSFTNGP05.phx.gbl...
> VFP7 XPSP2
> I have known lately that sending CTRL and "+"' to a grid or listview
> will automatically adjust column width in the grid (Windows Shortcut).
> how i can send CTRL and '+' using KEYBOARD in VFP?
>
> I found this code to for C
> SendKeys.Send ("^{+}");
>
http://www.codeproject.com/cs/miscctrl/AutoResize.asp
> Thanks in advance
>
>