Solved

How can I draw a control over two panels

Posted on 2004-04-28
8
171 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

19 Experts available now in Live!

Get 1:1 Help Now