mattjulius
asked on
Put image to Flexgrid
Just wanna ask how can I put an image to flexgrid.
example:
I have add, delete, edit button (serve as button) and the flex grid has 10 data from my database, what I want to do is to loop these images according to the data from dbase.So, If I have 10 records all of them has these buttons...
example:
I have add, delete, edit button (serve as button) and the flex grid has 10 data from my database, what I want to do is to loop these images according to the data from dbase.So, If I have 10 records all of them has these buttons...
Or u can add pictures to an ImageList Control
and these images can be used to set in FlexGrid control
like this,
Set MSFlexGrid1.CellPicture = ImageList1.ListImages(0).P icture ' You can change ListImage index to get different pics
and these images can be used to set in FlexGrid control
like this,
Set MSFlexGrid1.CellPicture = ImageList1.ListImages(0).P
ASKER
what I need is these images which serves as button (add,edit,delete) will loop according to the data in my databases.
ok that means
in each row of ur MsFlex u need to have buttons ADD,Edit and delete ? right
and u need to handle click events for each ?
in each row of ur MsFlex u need to have buttons ADD,Edit and delete ? right
and u need to handle click events for each ?
for that u need to dedicate first 3 columns for images
ASKER
How can I loop those images (w/c serves as button) in flexgrid with all of the data in there has images..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes its working thanks BUT CAN I ASK ONE MORE: HOW CAN I PUT MOUSE OVER ON THOSE PICTURE?
ASKER
PLUS HOW CAN I merge column
i am at office right now and i havent tried these codes,
pls try and let me know the results
http://xtremevbtalk.com/showthread.php?t=53551
http://www.pbdr.com/vbtips/gen/Article-UsingFlexGrids(3).htm
http://www.codecomments.com/Visual_Basic_Controls/message711326.html
and the mouse over matter , i will try it out and inform u if its possible with Msflexgrid
Regards
Shiju
pls try and let me know the results
http://xtremevbtalk.com/showthread.php?t=53551
http://www.pbdr.com/vbtips/gen/Article-UsingFlexGrids(3).htm
http://www.codecomments.com/Visual_Basic_Controls/message711326.html
and the mouse over matter , i will try it out and inform u if its possible with Msflexgrid
Regards
Shiju
also pls have a look at these PAQ's
https://www.experts-exchange.com/questions/10416961/merging-column-cells-in-msflexgrid.html
https://www.experts-exchange.com/questions/20998989/How-do-I-merge-cell-in-a-MSFlexGrid.html
https://www.experts-exchange.com/questions/21435980/Can-I-merge-cells-in-MSFlexgrid-for-headings-only.html
https://www.experts-exchange.com/questions/21425592/Can-I-merge-cells-and-align-center-vertical-and-horizontal-headings-in-MSFlexGrid.html
https://www.experts-exchange.com/questions/10416961/merging-column-cells-in-msflexgrid.html
https://www.experts-exchange.com/questions/20998989/How-do-I-merge-cell-in-a-MSFlexGrid.html
https://www.experts-exchange.com/questions/21435980/Can-I-merge-cells-in-MSFlexgrid-for-headings-only.html
https://www.experts-exchange.com/questions/21425592/Can-I-merge-cells-and-align-center-vertical-and-horizontal-headings-in-MSFlexGrid.html
ASKER
Thanks for the links...........
this link merge by cell by column(fix column).
http://www.codecomments.com/Visual_Basic_Controls/message711326.html
this link merge by cell by column(fix column).
http://www.codecomments.com/Visual_Basic_Controls/message711326.html
ASKER
What If instead of image i want a button? can I change your code as ( PicturePath As Button).
Hi mattjulius
that means ur column merge problem solved ?
you can set only pictures there
you can place images of buttons, so that it will look as if buttons (i recommend)
if u really want to place buttons,
u can have a seperate button and on click we can position the button so that it will look as it is inside the msflex column
that means ur column merge problem solved ?
you can set only pictures there
you can place images of buttons, so that it will look as if buttons (i recommend)
if u really want to place buttons,
u can have a seperate button and on click we can position the button so that it will look as it is inside the msflex column
ASKER
Thanks a lot.
ASKER
But is it possible to make mouse over?
Hi
u can make use of MouseCol and MouseRow properties
here is a sample code for u to test
Private Sub MSFlexGrid1_LeaveCell()
MSFlexGrid1.CellBackColor = MSFlexGrid1.BackColor
End Sub
Private Sub MSFlexGrid1_MouseMove(Butt on As Integer, Shift As Integer, x As Single, y As Single)
MSFlexGrid1.col = MSFlexGrid1.MouseCol
MSFlexGrid1.row = MSFlexGrid1.MouseRow
MSFlexGrid1.CellBackColor = vbBlue
End Sub
u can make use of MouseCol and MouseRow properties
here is a sample code for u to test
Private Sub MSFlexGrid1_LeaveCell()
MSFlexGrid1.CellBackColor = MSFlexGrid1.BackColor
End Sub
Private Sub MSFlexGrid1_MouseMove(Butt
MSFlexGrid1.col = MSFlexGrid1.MouseCol
MSFlexGrid1.row = MSFlexGrid1.MouseRow
MSFlexGrid1.CellBackColor = vbBlue
End Sub
Private Sub Command1_Click()
SetFlexPic 1, 1, "C:\pic.ico"
End Sub
Private Sub SetFlexPic(row As Integer, col As Integer, PicturePath As String)
MSFlexGrid1.row = row
MSFlexGrid1.col = col
Set MSFlexGrid1.CellPicture = LoadPicture(PicturePath)
MSFlexGrid1.Refresh
End Sub