Link to home
Start Free TrialLog in
Avatar of CConchelos
CConchelos

asked on

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..
ASKER CERTIFIED SOLUTION
Avatar of Bandy
Bandy

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CConchelos
CConchelos

ASKER

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.
choosing
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.SetFocus
    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

etc.

Does this help any more?

Bandy.
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..
  Chris