Msflexgrid usage tips: An Example

Source: Internet
Author: User

Originally, the msflexgrid control skills were presented through the encoding rule control of basic classification files in ERP. You only need to add a msflexgrid and combo control to the control. The source code is as follows:

 

Option explicit

 

Private sub combow.click ()

Msflexgrid1.text = combo1.text

End sub

 

Private sub combow.keypress (keyascii as integer)

If keyascii = vbkeyescape then

Combo1.visible = false

Msflexgrid1.setfocus

Exit sub

End if

 

If keyascii = vbkeyreturn then

Msflexgrid1.text = combo1.text

Combo1.visible = false

Msflexgrid1.setfocus

End if

End sub

 

Private sub combow.lostfocus ()

Combo1.visible = false

Msflexgrid1.setfocus

Exit sub

End sub

 

Private sub form_load ()

Dim I as integer

Dim width, text, Archives

Width = array ("400", "2100", "800", "800", "800", "800", "800", "800", "800 ", "800", "800 ")

TEXT = array ("no.", "file name", "1st", "2nd", "3rd", "4th", "5th ", "level 6th", "level 7th", "level 8th", "level 9th ")

Archives = array ("null", "subject", "project category", "fixed asset category", "Department Category", "employee category", "supplier category ", "Customer classification", "seller Classification", "Region Classification", "warehouse receiving and picking category", "Inventory Classification", "Reserved 12", "Reserved 13", "Reserved 14 ", "reserved 15", "Reserved 16", "Reserved 17", "reserved 18", "Reserved 19", "reserved 20 ")

With msflexgrid1

. Rows = 21

. Cols = 11

. Fixedcols = 2

. Fixedrows = 1

End

 

For I = 1 to 9

Combo1.additem I

Next I

 

For I = 0 to 10

Msflexgrid1.colwidth (I) = width (I)

Msflexgrid1.textmatrix (0, I) = text (I)

Next I

 

For I = 1 to 20

With msflexgrid1

. Textmatrix (I, 0) = I

. Textmatrix (I, 1) = archives (I)

. Rowheight (I) = 300

End

Next I

End sub

 

Private sub msflexgrid1_click ()

Dim C as integer, R as integer

With msflexgrid1

C =. Col

R =. Row

If C> 1 and R> 0 then

Combo1.left =. Left +. colpos (c) + 50

Combo1.top =. Top +. rowpos (r) + 50

Combo1.width =. colwidth (c)

Combo1.text =. Text

Combo1.visible = true

Combo1.setfocus

End if

End

End sub

 

Private sub msflexgrid1_keypress (keyascii as integer)

If keyascii = vbkeyreturn then

Call msflexgrid1_click

End if

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.