What control is it?

Posted on 2003-03-06
Medium Priority
Last Modified: 2013-12-25
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..
Question by:CConchelos
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2

Accepted Solution

Bandy earned 400 total points
ID: 8085710
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.

Author Comment

ID: 8088628
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.

Author Comment

ID: 8088634
Independent Software Vendors: 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!


Author Comment

ID: 8090924
it will work, thanks for the point in the right direction..

Expert Comment

ID: 8106524
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?


Author Comment

ID: 8114365
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..

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month7 days, 21 hours left to enroll

765 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