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
Solved

How can I draw a control over two panels

Posted on 2004-04-28
8
174 Views
Last Modified: 2012-05-04
I have a user control which consists of a  combobox that when its button is pressed i present a listview directly underneath it. When placed inside a panel the listview goes over the bottom edge of the panel and dissapears. I can see that the combobox lisrt if pressed near the bottom edge of the panel has no problem showing over the panel edge.

How can this be done with my control? What I really want to end-up with is a multi-collumn combobox.

Thanks
0
Comment
Question by:pallmall77
  • 5
  • 2
8 Comments
 
LVL 2

Expert Comment

by:Jeffr0
ID: 10940514
0
 
LVL 2

Expert Comment

by:Jeffr0
ID: 10940667
It sounds like the User Control is only showing items that are within the it's coordinates.

You may have to stretch it out some to see all of the controls that are inside of it.  Of course, you probably want the button to be right under it for some reason....   Hmmm....  Maybe you can make sure that the UserControl is "Brought to the Front" so that it is on top of the button.  When you've got your dropdown's open, you can make sure that the size of the UserControl is expanded.  When an item is selected you could shrink it back-- that way the button isn't obscured _all_ the time.

This is my guess without building a test case.
0
 
LVL 2

Expert Comment

by:Jeffr0
ID: 10940781
Yes.  It does work.

Here's the code I used:

 Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Me.UserControl11.Size = New System.Drawing.Size(168, 121)
    End Sub

    Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
        Me.UserControl11.Size = New System.Drawing.Size(168, 40)
    End Sub

My UserControl Has additional controls that are obscurred when he's small.  I right-clicked him and selected "Bring to Front" to ensure that he was on top of any surrounding controls when he expanded.
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 2

Expert Comment

by:Jeffr0
ID: 10940839
The only thing I see that I may have missed is in regard to the "panels" you mentioned.  If I've failed to address your problem, please clarify how you are using them and how they affect this situation.
0
 

Author Comment

by:pallmall77
ID: 10946683
Imagine you have two panels docked top so one is underneath the other. Say that the top panel is your buttons and search criteria panel and the bottom contains a datagrid. The top panels takes all the screen in width (i.e. docked top) but has a small height. If you put a combobox on that panel and press its button the list that opens underneath spans over the panel which is docked underneath.

In my control since I just position a listview underneath my combobox (i.e. trying to pretend to the user that the listview is part of the combobox) what happens is that the listview dissapears behind the docked panel below. Even if I say bringtofront it does nothing.

I will check the link you sent me on the multi-combo and get back to you. if you have any ideas on how to make my control work go ahead.

Thanks a lot

0
 

Author Comment

by:pallmall77
ID: 10946969
I tried the link but it is a VS-2003 project. I tried converting it but It didint convert right and I am getting errors
Is there a multi collumn combobox like that for VS-2002?


0
 
LVL 2

Accepted Solution

by:
Jeffr0 earned 500 total points
ID: 10948383
To make the code work, first go here:

http://www.codeproject.com/macro/vsconvert.asp

1)  Download and unzip the "Working Application."

2)  Run the exe.  Click add files and select all of the files in all of the folders of the Multi-column combo project.

3)  Click "To VS 7.0"

4)  Now double click the Combo Project to open it.

5)  There is a minor change to make-- you'll see the syntax errors in the Task List.  Double click one of the errors to get to it.  Change the faulty line ("For i As Integer = 0 To 100") to this:

Dim i As Integer
For i = 0 To 100

6)  Hit F5 and check it out!!
0

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

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

856 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