Solved

How can I draw a control over two panels

Posted on 2004-04-28
8
172 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

867 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now