Showing an image control in msflexgrid

Hw to display an image control in msflexgrid on clicking which do some

Page 1 of 1

1 Replies - 8236 Views - Last Post: 15 January 2010 - 03:58 AM Rate Topic: -----

#1 neethups  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 15-January 10

Showing an image control in msflexgrid

Post icon  Posted 15 January 2010 - 02:46 AM

Private Sub display_Click()
Dim i As Integer
msf.Rows = 1
msf.Cols = 4
With msf
.TextMatrix(0, 0) = ""
.TextMatrix(0, 1) = ""
.TextMatrix(0, 2) = "CODE"
.TextMatrix(0, 3) = "NAME"
End With
Set rs1 = New ADODB.Recordset
i = 1
With rs1
.ActiveConnection = nithu1.cnn
.Open "select * from customer", , , , adCmdText
.MoveFirst
While Not rs1.EOF
msf.Rows = msf.Rows + i
With msf
.TextMatrix(i, 0) = HERE I WANT TO DISPLAY EDIT IMG CTRL that triggers an action
.TextMatrix(i, 1) = HERE I WANT TO DISPLAY DELETE IMG CTRL
.TextMatrix(i, 2) = rs1(0)
.TextMatrix(i, 3) = rs1(1)
i = i + 1
rs1.MoveNext
End With
Wend
.Close
End With
End Sub

Is This A Good Question/Topic? 0
  • +

Replies To: Showing an image control in msflexgrid

#2 raziel_  Icon User is offline

  • Like a lollipop
  • member icon

Reputation: 465
  • View blog
  • Posts: 4,255
  • Joined: 25-March 09

Re: Showing an image control in msflexgrid

Posted 15 January 2010 - 03:58 AM

hello :)

using this tut.
http://www.dreaminco...topic132258.htm
witch show how to show textbox on a selected cell i modify it and here is an example of how to show picture box on a second cell on the second row

Private Sub Command1_Click()
Dim tL As Long, tH As Long, tW As Long, tT As Long 'MSFlexGrid cell boundary'

	With MSFlexGrid1
		' make col1 on row1 selected '
		.RowSel = 1
		.ColSel = 1
		
		tT = .CellTop
		tL = .CellLeft
		tH = .CellHeight
		tW = .CellWidth
		'Move the picture box on the selected cell'
		Picture1.Move tL + .Left, tT + .Top, tW + 2 * Screen.TwipsPerPixelX, tH
	End With
End Sub



good luck :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1