How to add a drop down box to MSFlexGrid

Source: Internet
Author: User

First, you should create a Combo1 combobox control as the final implementation tool for the Drop-down box.

Private Sub Combo1_click ()
Msflexgrid1.row = Msflexgrid1.rowsel
Msflexgrid1.col = 2
Msflexgrid1.text = Combo1.text
End Sub

' Private Sub combo1_lostfocus ()
' Combo1.text = Msflexgrid1.text

' End Sub
Private Sub Form_Load ()
Combo1.visible = False
Combo1.additem "AAA"
Combo1.additem "BBB"
Combo1.additem "CCC"
Msflexgrid1.cols = 10
Msflexgrid1.rows = 10
End Sub
Private Sub Msflexgrid1_entercell ()
If Msflexgrid1.col = 2 Then
Msflexgrid1.cellbackcolor = Vbwhite
Msflexgrid1.cellforecolor = Vbblue
Combo1.move Msflexgrid1.left + msflexgrid1.cellleft, Msflexgrid1.top + msflexgrid1.celltop, MSFlexGrid1.CellWidth
Combo1.visible = True
' Combo1.text = Msflexgrid1.text
Else
Exit Sub
End If

' Combo1.selstart = 0
' Combo1.sellength = Len (Combo1.text)
End Sub
Private Sub Msflexgrid1_leavecell ()
' If Msflexgrid1.col = 2 Then
Msflexgrid1.cellbackcolor = Vbwhite
Msflexgrid1.cellforecolor = Vbblue
' Combo1.move Msflexgrid1.left + msflexgrid1.cellleft, Msflexgrid1.top + msflexgrid1.celltop, MSFlexGrid1.CellWidth
' Msflexgrid1.text = Combo1.text
' Else
' Exit Sub
' End If
End Sub
' Private Sub combo1_change ()
' Msflexgrid1.row = Msflexgrid1.rowsel
' Msflexgrid1.col = 2
' Msflexgrid1.text = Combo1.text
' End Sub
Private Sub Timer1_timer ()
timer1.enabled = True
Combo1.visible = False
End Sub

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.