Click here to Skip to main content
15,885,908 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi all,
Lets jump right into it.

I have a user control s that is loaded with information from a data base. call it ListItem --
type is userControl

ListItem is loaded into a flow layout panel that is docked into a parent window - parent window is called PopUpBox -- type is system.winows.form - no borders

Now I have another control that needs to act like a combobox Where PopUpBox is the selection menu
that is displayed -- Call this control Custom_Combo


The question is, what do I need to do in order to make popupBox appear directly under the
Custom_Combo when when the collapse button is pressed. More specifically, I am having trouble with determining the location at which to display my PopUpBox. I can't seem to get load it directly under the Custom_Combo.


Any thoughts?

This is my first post so I apologize for any mistakes I've made in posting. Thank you in advance for any help.
Posted
Updated 28-Jul-13 9:01am
v2
Comments
[no name] 28-Jul-13 14:29pm    
Any thoughts.... about what?
Mr.TMG 28-Jul-13 14:54pm    
Good point. I will adjust my question.

1 solution

Well that was easy..

VB
Public Class IP_ServiceDisplay ' Custom Combo

    Property x As New IPLine_Panels.Task_PopupPanel ' Popupbox



    Private Sub IP_ServiceDisplay_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        Dim screenpos As Drawing.Point = Me.PointToScreen(New Drawing.Point(0, 0))

        x.Location = screenpos

        x.Show() 'the popup box will adjust it's size and location, based on it's parents height width and and the number of controls it contains






    End Sub
End Class


And popup box contains Me.Hide in the Lost_Focus event Handler
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900