Solved

How can I draw a control over two panels

Posted on 2004-04-28
8
173 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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 …
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

813 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

15 Experts available now in Live!

Get 1:1 Help Now