Solved

Place CheckBox on MSFlexGrid & must be Scroll as Grid get scrolled up & down

Posted on 2001-07-13
5
364 Views
Last Modified: 2012-05-04
hallo sir,

how to place a CheckBox on MsFlexGrid for all the Rows, if 5 rows are visible & 20 rows are unscolled then how the CheckBox will move as grid will scorll as grid will scoll up & down ?

Thanx,
Pl do the needful.

Santosh
0
Comment
Question by:SantoshGokhale
5 Comments
 

Accepted Solution

by:
surki earned 50 total points
ID: 6280163
Santhosh:

Instead of using Flex grid use "List view control" were u can use the check boxes(Setting the Properties).

Add Microsoft Windows Common Controls 6.0(sp3)"VB"
and Pick List View Control were in u got option of using check boxes with the list.

Hope this helps.
0
 
LVL 28

Expert Comment

by:iboutchkine
ID: 6280746
'2 pictures on the form picChecked and picUnchecked

Private Sub SetRow(ByVal idx As Integer, ByVal person_name As String, ByVal needs_air As Boolean, ByVal needs_hotel As Boolean, ByVal needs_car As Boolean)
    With MSFlexGrid1
        .TextMatrix(idx, 0) = person_name
        .Row = idx

        .Col = 1
        If needs_air Then
            Set .CellPicture = picChecked.Picture
        Else
            Set .CellPicture = picUnchecked.Picture
        End If

        .Col = 2
        If needs_hotel Then
            Set .CellPicture = picChecked.Picture
        Else
            Set .CellPicture = picUnchecked.Picture
        End If

        .Col = 3
        If needs_car Then
            Set .CellPicture = picChecked.Picture
        Else
            Set .CellPicture = picUnchecked.Picture
        End If
    End With
End Sub
Private Sub Form_Load()
    With MSFlexGrid1
        .BackColor = &HE0E0E0
        .Rows = 4
        .Cols = 4
        .FixedCols = 1
        .FixedRows = 1

        .TextMatrix(0, 0) = "Name"
        .TextMatrix(0, 1) = "Air"
        .TextMatrix(0, 2) = "Hotel"
        .TextMatrix(0, 3) = "Car"
    End With

    SetRow 1, "Alice", True, True, False
    SetRow 2, "Bob", True, False, False
    SetRow 3, "Carter", False, False, True
End Sub

Private Sub Form_Resize()
    MSFlexGrid1.Move 0, 0, ScaleWidth, ScaleHeight
End Sub


' Toggle the check box.
Private Sub MSFlexGrid1_Click()
    If MSFlexGrid1.Col < 1 Or MSFlexGrid1.Row < 1 Then Exit Sub

    If MSFlexGrid1.CellPicture = picChecked Then
        Set MSFlexGrid1.CellPicture = picUnchecked
    Else
        Set MSFlexGrid1.CellPicture = picChecked
    End If
End Sub
0
 

Author Comment

by:SantoshGokhale
ID: 6284573
Hello
Mr. Surki & Mr. iboutchkine,

Thanx a lot for yr immidiate reply with good answers. This will help me a lot.

Thanx.
From Santosh.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7153083
SantoshGokhale@devx, an EE Moderator will handle this for you.
Moderator, my recommended disposition is:

    Split points between: surki and iboutchkine

DanRollins -- EE database cleanup volunteer
0
 
LVL 5

Expert Comment

by:Netminder
ID: 7182160
Per recommendation, force-accepted.

Netminder
CS Moderator

iboutchkine: points for you at http://www.experts-exchange.com/jsp/qShow.jsp?ta=visualbasic&qid=20328908
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adding to a VBA? 6 82
VBA: Personal Macro Retain/Highlight/Remove values in a selected column 4 35
Excel Automation VBA 19 102
add criteria to query in VB, Access 2003 2 29
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

685 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question