darshan_gandhi
11 years agoOccasional Contributor
MSFlex Grid issue
Hi,
I am working on a Windows based application designed in VB6.
We are having a grid which is a MSFlex grid and inside that grid we have a ComboBox (in each cell) to select a specific value. But this combo box object is not enabled until we click on the grid.
Can someone please let me know how can we determine how we can code for clicking on a specific cell in the grid and then selecting the value. I tried recording and it gives me hard code value for CLick method.
I want somethin where I first identify the Column header and then click on specific cell using row index.
Also I wanted to know if we can capture the status(enabled/disabled) of the cells.
Just for the information, the grid properties does not have (.Cell) although it does have other cell related properties like (.CellWidth, .CellHeight).
Can someone please help me as I am stuck from last few days with no solution :(
Thanks,
Darshan Gandhi
I am working on a Windows based application designed in VB6.
We are having a grid which is a MSFlex grid and inside that grid we have a ComboBox (in each cell) to select a specific value. But this combo box object is not enabled until we click on the grid.
Can someone please let me know how can we determine how we can code for clicking on a specific cell in the grid and then selecting the value. I tried recording and it gives me hard code value for CLick method.
I want somethin where I first identify the Column header and then click on specific cell using row index.
Also I wanted to know if we can capture the status(enabled/disabled) of the cells.
Just for the information, the grid properties does not have (.Cell) although it does have other cell related properties like (.CellWidth, .CellHeight).
Can someone please help me as I am stuck from last few days with no solution :(
Thanks,
Darshan Gandhi
- As this grid is not supported there is no builtin method to click cell. however u can find the coodrinates of cell click onthe paricular celll. here is the sample code
Msflexgrid.setfocus
Msflexgrid.row=1 'row Value
Msflexgrid.col=1 'ColumnValue
'to calculate the coordinates of the cell
x=Msflexgrid.CellTop+form.Top
y=Msflexgrid.CellLeft+form.Left
'to convert twip into pixels
twip_pixel_ratio = form.ScaleWidth / form.Width
x = x/twip_pixel_ratio
y = y/twip_pixel_ratio
Call Msflexgrid.Click( y ,x) 'Clicks the 1st cell