如何在运行时删除SplitterPanel? [英] How to remove SplitterPanel at runtime?

查看:95
本文介绍了如何在运行时删除SplitterPanel?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里遇到问题.

我在运行时创建了对象(例如面板和按钮),我也需要在运行时将其删除.
我该怎么办?

这是我尝试过的代码:

Hi, I had a problem here.

I created object at runtime (such as panel and button) and I need to remove it at RUNTIME too.
How could I do that?

This is the code that i''d tried :

'Here's the code I use to create the object

Dim panelMenu As New SplitContainer
Dim leftP As New ucLeftMenu

.
.
.
.
'and these the code that i'd tried to remove those objects


            With Me.Controls
                .Remove(leftP)
                .Remove(panelMenu)
            End With





但是结果却不如预期.
panelMenu仍然存在并且可见.

如何解决?

在此先感谢

[edit]将我的内容视为纯文本..."选项已禁用-OriginalGriff [/edit]





But the result is not as expected.
The panelMenu still exist and visible.

How to fix it?

Thanks in advance

[edit]"Treat my content as plain text..." option disabled - OriginalGriff[/edit]

推荐答案

您的设计没有任何意义.您为什么要删除分离器?如果需要,我可以使用第二种形式,即没有拆分器,而不必花很多钱从拆分器面板中删除控件,而必须手动删除所有事件处理程序.如果您想把所有这些东西放回原处,那就更糟了.
Your design doesn''t make any sense. Why would you want to remove the splitter?? If it was a requirement, I would have a second form the doesn''t have the splitter instead of going through the expense of removing controls from the splitter panels and having to tear out all the events handlers manually. It gets worse if you want to put all this stuff back.


这篇关于如何在运行时删除SplitterPanel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆