Hi all,
I'm having problem to capture last grid's column (identified as number) after new left-mouseclick other column's.
Let said I obtain column 3 from first setfocus of column 3 (column's cell selection) and I proceed to left-mouselick on columns 4.
It would return as 4 but doesn't match to what i need is 3.How could I suppose to get 3.
Code in Form
public precolumn
with thisform.grid_list
.addobject("column2","column")
.columns(2).visible = .t.
.columns(2).width = 55
.columns(2).header1.alignment = 2
.columns(2).header1.caption = "Supcode"
.columns(2).removeobject("text1")
.columns(2).addobject("text1","text_")
.columns(2).text1.visible = .t.
.columns(2).sparse = .t.
endwith
Code in main.prg
define class text_ as textbox
borderstyle = 0
procedure mousedown
LPARAMETERS nButton, nShift, nXCoord, nYCoord
curcontrol = _screen.activeform.activecontrol
curcolumn = curcontrol.activecolumn
messagebox("check column(beforepress):" + trans(precolumn)) =>It suppose return 3(column number3),but it just give 4(new left mouseclick on column's cell)
=>I want to get 3 instead of 4.
endpro
procedure gotfocus ** (Capture and stored column in public variable for later comparison in next mouse-click event) **
precontrol = _screen.activeform.activecontrol
precolumn = precontrol.activecolumn
endpro
enddefine
Thanks Appopriate to anyone answers and helps.
I'm having problem to capture last grid's column (identified as number) after new left-mouseclick other column's.
Let said I obtain column 3 from first setfocus of column 3 (column's cell selection) and I proceed to left-mouselick on columns 4.
It would return as 4 but doesn't match to what i need is 3.How could I suppose to get 3.
Code in Form
public precolumn
with thisform.grid_list
.addobject("column2","column")
.columns(2).visible = .t.
.columns(2).width = 55
.columns(2).header1.alignment = 2
.columns(2).header1.caption = "Supcode"
.columns(2).removeobject("text1")
.columns(2).addobject("text1","text_")
.columns(2).text1.visible = .t.
.columns(2).sparse = .t.
endwith
Code in main.prg
define class text_ as textbox
borderstyle = 0
procedure mousedown
LPARAMETERS nButton, nShift, nXCoord, nYCoord
curcontrol = _screen.activeform.activecontrol
curcolumn = curcontrol.activecolumn
messagebox("check column(beforepress):" + trans(precolumn)) =>It suppose return 3(column number3),but it just give 4(new left mouseclick on column's cell)
=>I want to get 3 instead of 4.
endpro
procedure gotfocus ** (Capture and stored column in public variable for later comparison in next mouse-click event) **
precontrol = _screen.activeform.activecontrol
precolumn = precontrol.activecolumn
endpro
enddefine
Thanks Appopriate to anyone answers and helps.