自定义DropDown列表中的用户控件 [英] User Controls in Custom DropDown list
问题描述
大家好,
让我们直接进入它。
我有一个用户控件加载了来自数据的信息基础。叫它 ListItem -
类型是userControl
ListItem 被加载到停靠在父窗口中的流布局面板 - 父窗口称为 PopUpBox - 类型为system.winows.form - 无边框
现在我有另一个需要像组合框一样的控件其中 PopUpBox 是选择菜单
显示 - 调用此控件 Custom_Combo
问题是,为了使 popupBox 直接出现,我需要做些什么按下折叠按钮时
Custom_Combo 。更具体地说,我在确定显示 PopUpBox 的位置时遇到问题。我似乎无法直接在 Custom_Combo 下加载它。
有什么想法?
这是我的第一篇帖子,所以我为发布的任何错误道歉。提前感谢您的帮助。
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.
推荐答案
这很简单..
Well that was easy..
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
和弹出框包含Lost_Focus事件处理程序中的Me.Hide
And popup box contains Me.Hide in the Lost_Focus event Handler
这篇关于自定义DropDown列表中的用户控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!