What control is it?

i am trying to find out what kind of control is used for the properties window in vb6. i am looking for the same functionality. i don't think it's a listview, but it looks like a listview.. i.e. clicking caption allows me to edit the caption cell, font brings up a button, and visible a drop down list of choices. this may be a combination of controls, but as long as i have an idea of what's involved, i can go from there..
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

BandyConnect With a Mentor Commented:
The way I'd do it is via a grid.
(Probably MsFlexGrid).

You can trap EnterCell events, and display a text-box over the top of the currently selected cell (I think the properties are something like celltop, cellleft, cellheight, cellwidth, to get the position of the current cell).

You could use a combo instead of a text-box if you need dropdowns, and If you want a popup, you can either use a combo box, and intercept clicks on the combo-box's button, or you could display your own text-box and a button over the top of the text box.

If you want navigation through the grid, you can trap the keypresses on the textbox, and see if it's the up/down/left/right arrow, and move the text-box to the next cell.

It's messy, but I still can't find a good, stable fully functioning, editable grid, so I usually make my own.

The good thing about that is that you don't have to make the whole grid editable. You can check which column, and row you are in before displaying the text-box, and you could optionally display either a textbox, combo, or your own custom popup.

Actually, about the best grid I've found is at http://vbaccelerator.com/
You could have a look there, it's got some pretty neat features.
CConchelosAuthor Commented:
i currently have a listview with 18 rows and 2 columns, in the second column i would like to give the option of replacing the text in some cells, and coosing from a list of options (probably from a dblist) in other cells. i would think that i could just check for clicks. on vbaccelerator the only grid i could come across was S-Grid. it was very cool, and could help me out with a different project i am trying to complete, but i don't think it does what i need here..

are you saying i check for the x and y in a grid, in certian cells i then popup a button, and then on the button click i show a dropdown? in my head this would be the process that would give the desired effect, i just thought there might be a control that already encompasses it. thanks for the outline i think i'll see if i can make some progress on it today.
CConchelosAuthor Commented:
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

CConchelosAuthor Commented:
it will work, thanks for the point in the right direction..
I know you've accepted already, but just in case, I'll try to answer some of your questions...

In the MSFlexGrid_Click() subroutine, you can find the current row and col using:
(assuming a Microsoft Flex Grid control named MSFlexGrid)
(Make the Col and row variables global, so that you can use them later)

    Col = MSFlexGrid.MouseCol
    row = MSFlexGrid.MouseRow

Then display a textbox over it using:
(assuming a textbox named Text1)

    Text1.Top = MSFlexGrid.Top + MSFlexGrid.RowPos(row)
    Text1.Left = MSFlexGrid.Left + MSFlexGrid.ColPos(Col)
    Text1.Height = MSFlexGrid.RowHeight(row)
    Text1.Width = MSFlexGrid.ColWidth(Col)
    Text1.Text = MSFlexGrid.TextMatrix(row, Col)
    Text1.Visible = True
    Text1.SelStart = 0
    Text1.SelLength = Len(Text1.Text)

then in Text1_Change event
(Remember we have global variables row and Col)

MSFlexGrid.TextMatrix(row, Col) = Text1.Text

or If you want a dropdown, you can use a combo box instead of a textbox in the example above

Or If you want a popup form, Try (in MSFlexGrid_Click):
(Assuming a command button called Cmd1)

    Cmd1.Top = MSFlexGrid.Top + MSFlexGrid.RowPos(row)
    Cmd1.Left = (MSFlexGrid.Left + MSFlexGrid.ColPos(Col) + MSFlexGrid.ColWidth(Col)) - 325
    Cmd1.Height = MSFlexGrid.RowHeight(row)
    Cmd1.Width = 325
    Cmd1.Text = "..."
    Cmd1.Visible = True

and then on Cmd1_Click
Popup the required form

Seeing as you know the column and row,
    Col = MSFlexGrid.MouseCol
    row = MSFlexGrid.MouseRow

you could even use all three of these options, using an "IF" statement.

on MSFlexGrid_Click

if Row = 1 then
    'Display Textbox
elseif Row = 2 then
    'Display Combo
elseif Row = 3 then
    'Display Button for Popup
end if


Does this help any more?

CConchelosAuthor Commented:
i did get the text box working, just like you've posted here, i thought i would follow the same idea for the drop down dbcombo. the only hurdle left is writing to a data source, but i think i can do that from the text1_change using a case statement instead of if then.. thanks a ton, youve really helped me through this..
All Courses

From novice to tech pro — start learning today.