拥有选项卡式MDI应用程序的最佳方式 [英] Best way to have a tabbed MDI application

查看:67
本文介绍了拥有选项卡式MDI应用程序的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


正如你们中的一些人从我以前的帖子中得知的那样,我正在用MDI将我们的Unix
基于
的系统重写为.Net界面。


最近我在MDI父表单的顶部添加了一个选项卡控件,

将包含每个打开的MDI子表单的标签页。它只有24像素

高,所以你看到的就是标签。然后我只需要添加一些代码来改变索引。选项卡控件的事件以及子窗体的on activate

事件(实际上是在所有子项继承的基本形式上完成的
)表格)确保如果点击标签

或其他子表单被激活,则当前子表单和当前

标签同步。


这里没什么太复杂的,但是我现在正在折腾是否要实现
实际上不再使用MDI子表格而只是创建所有预期的

子窗体作为用户控件,在需要时将其插入新选项卡

页面。但我不确定这是否会让我在管理

标签页而不是MDI子表格时感到头痛。


我对MDI的问题应用程序阻止用户更改子窗体的状态 - 我希望它始终最大化。

有没有办法阻止显示MDI

表格右上角的控制盒?


无论如何如果人们可以在选项卡上分享他们的经验,那将是很棒的,因为我可以在做出决定之前了解任何陷阱。

tia,

Mac


-

留言通过DotNetMonster.com发布
http://www.dotnetmonster.com/Uwe/For ... b-net / 200512/1

Hi all,

As some of you would know from my previous posts that I am rewriting our Unix
based system into .Net with a MDI interface.

Recently I have added a tab control to the top of the MDI parent form that
will contain a tab page for each open MDI child form. It is only 24 pixels
high so all you see is the tabstrip. Then I only have to add a bit of code to
the "changed index" event of the tab control as well as the "on activate"
event for the child forms (which is actually done on a baseform which is
inherited by all the child forms) to ensure that if either a tab is clicked
or another child form is activated then the current child form and current
tab are in sync.

Nothing too complicated here, but I am currently tossing up whether to
actually do away with having MDI child forms and just create all the intended
child forms as user controls which when required are inserted onto a new tab
page. But I am unsure if this is going to create headaches for me in managing
tab pages rather than MDI child forms.

The problem I have with an MDI app is preventing the users from changing the
state of the child form - I would like to have it maximised all the time. Is
there way to prevent the control box in the upper right corner of the MDI
form from being displayed?

Anyway, it would be great if people could share their experiences on tabbed
MDI applications so I can be aware of any pitfalls before I make the decision.
tia,

Mac

--
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...b-net/200512/1

推荐答案

Mac,


我这样做了我觉得它很好用。使用选项卡控件,

然后将每个表单设置为其父项到标签页。你把

boder关掉,把码头设置为填充然后你去。


这样的东西......

dim fObjSelector as frmObjectSelector

fObjSelector = new frmObjectSelector

fObjSelector.FormBorderStyle = FormBorderStyle.None

fObjSelector.TopLevel = False

fObjSelector.Parent = Me.FromHandle(TabControl1.TabPages(0).Handle)

fObjSelector.Dock = DockStyle.Fill

fObjSelector.Show()


jeff


" Mac via DotNetMonster.com" < u9483 @乌韦>写在消息中

新闻:58803686cbc54 @ uwe ...
Mac,

I did this and I thought it worked out pretty well. Use the tab control,
then instantiate each form setting its parent to the tab page. You take the
boder off, set the dock to fill and there you go.

something like this...
dim fObjSelector as frmObjectSelector
fObjSelector = New frmObjectSelector
fObjSelector.FormBorderStyle = FormBorderStyle.None
fObjSelector.TopLevel = False
fObjSelector.Parent = Me.FromHandle(TabControl1.TabPages(0).Handle)
fObjSelector.Dock = DockStyle.Fill
fObjSelector.Show()

jeff

"Mac via DotNetMonster.com" <u9483@uwe> wrote in message
news:58803686cbc54@uwe...
大家好,

正如你们中的一些人从我以前的帖子中知道的那样我我用基于MDI的界面将基于Unix的系统重写为.Net。

最近我在MDI父表单的顶部添加了一个选项卡控件
将包含每个打开的MDI子窗体的标签页。它只有24像素高,所以你看到的只是标签。然后我只需要添加一些代码
来改变改变的索引。选项卡控件的事件以及子窗体的on activate事件(实际上是在所有子窗体继承的基本窗体上完成),以确保单击选项卡
或其他子表单已激活,然后当前子表单和当前
选项卡同步。

此处没有太复杂,但我目前折腾是否实际上不再使用MDI子表格,只需创建所有
预期的子表单作为用户控件,在需要时将其插入新的
选项卡
页面。但是我不确定这是否会在管理
标签页而不是MDI子表格中给我带来麻烦。

我对MDI应用程序的问题是阻止了用户改变了儿童形态的状态 - 我希望它能一直最大化。
是否有办法防止右上角的控制盒MDI
表单的显示方式?

无论如何,如果人们可以在选项卡上分享他们的经验,那将是很棒的MDI应用程序,所以我可以知道在做出决定之前的任何陷阱。

tia,

Mac

-
通过DotNetMonster发布的消息。 com
http:/ /www.dotnetmonster.com/Uwe/For...b-net/200512/1



Mac,


首先坐在用户的椅子上。


Im老化,使用word而不是它是一个MDI应用程序,因为它是,你已经用Tab控件扩展它,其中可以是你所有的b
文件是开放的。


如果我在屏幕上直接打开4个mdi doc文件,我就会感到困惑。

我的屏幕。虽然你想隐藏它们甚至在页面中。


我希望这能给你一个想法。

要给出一个确切的答案,我认为MDI或Tab页面,而不是两者。


对我来说,技术上不错的解决方案并不总是一个好的用户解决方案。


Just我的想法,


Cor

" Mac via DotNetMonster.com" < u9483 @乌韦> schreef在bericht

新闻:58803686cbc54 @ uwe ...
Mac,

Go first sit on the chair of your user.

Imaging that are using word and instead of that it is a MDI application as
it is, you have extended it with a Tab control where in can be all your
documents that are open.

I become already confused if I have 4 mdi doc files open in Word direct on
my screen. While you want to hide them even in tabpages.

I hope that this gives you an idea.
To give an exact answer, it is in my opinion a MDI or a Tab page, not both.

For me is a technical nice solution is not always a good user solution.

Just my thought,

Cor
"Mac via DotNetMonster.com" <u9483@uwe> schreef in bericht
news:58803686cbc54@uwe...
大家好,

正如你们中的一些人从我以前的帖子中知道的那样我我用基于MDI的界面将基于Unix的系统重写为.Net。

最近我在MDI父表单的顶部添加了一个选项卡控件
将包含每个打开的MDI子窗体的标签页。它只有24像素高,所以你看到的只是标签。然后我只需要添加一些代码
来改变改变的索引。选项卡控件的事件以及子窗体的on activate事件(实际上是在所有子窗体继承的基本窗体上完成),以确保单击选项卡
或其他子表单已激活,然后当前子表单和当前
选项卡同步。

此处没有太复杂,但我目前折腾是否实际上不再使用MDI子表格,只需创建所有
预期的子表单作为用户控件,在需要时将其插入新的
选项卡
页面。但是我不确定这是否会在管理
标签页而不是MDI子表格中给我带来麻烦。

我对MDI应用程序的问题是阻止了用户改变了儿童形态的状态 - 我希望它能一直最大化。
是否有办法防止右上角的控制盒MDI
表单的显示方式?

无论如何,如果人们可以在选项卡上分享他们的经验,那将是很棒的MDI应用程序,所以我可以知道在做出决定之前的任何陷阱。

tia,

Mac

-
通过DotNetMonster发布的消息。 com
http:/ /www.dotnetmonster.com/Uwe/For...b-net/200512/1



你好Jeff,


我无法尝试重现您的解决方案。如果我正确理解了

,就好像你有一个表格,你正在插入

a tabpage,这意味着你实际上并没有设置MDIParent属性这些

形式呢?这是正确的吗?


你的frmObjectSelector的类型是什么?此外,这个代码

的确切位置 - 以您的容器形式放置?即使我知道它们存在,我也无法访问Me.Fromhandle属性或TopLevel属性。


你能否给我一些关于你如何进一步的信息得到了这个解决方案 - 我

非常喜欢它的声音。如果它表现得像我认为的那样,它将会克服我(并且Cor指出)有一个独立的

tabcontrol和MDI表格的问题。 br $> b $ b问候,


Mac


Jeff Jarrell写道:
Hi Jeff,

I am having difficulty trying to reproduce your solution. If I understand
correctly, it appears as though you have a form which you are slotting in as
a tabpage, which means you don''t actually set the MDIParent property of these
forms at all? Is this correct?

And your frmObjectSelector is of type form? Also where exactly is this code
placed - in your container form? Even though I know they exist, I cannot
access the Me.Fromhandle property or the TopLevel property.

Can you give me some further info on how you got this solution going - I
really like the sound of it. It if it behaves like it I think it will, it
will overcome the issue I had (and Cor pointed out) of having a detached
tabcontrol and MDI forms.
regards,

Mac

Jeff Jarrell wrote:
Mac,

我这样做了,我觉得它很好用。使用选项卡控件,
然后将每个表单设置为其父项到标签页。你把
boder关闭,把Dock设置为填充然后你去。

这样的东西......
dim fObjSelector as frmObjectSelector
fObjSelector = new frmObjectSelector
fObjSelector.FormBorderStyle = FormBorderStyle.None
fObjSelector.TopLevel = False
fObjSelector.Parent = Me.FromHandle(TabControl1.TabPages(0).Handle)
fObjSelector.Dock = DockStyle .Fill
fObjSelector.Show()

jeff
Mac,

I did this and I thought it worked out pretty well. Use the tab control,
then instantiate each form setting its parent to the tab page. You take the
boder off, set the dock to fill and there you go.

something like this...
dim fObjSelector as frmObjectSelector
fObjSelector = New frmObjectSelector
fObjSelector.FormBorderStyle = FormBorderStyle.None
fObjSelector.TopLevel = False
fObjSelector.Parent = Me.FromHandle(TabControl1.TabPages(0).Handle)
fObjSelector.Dock = DockStyle.Fill
fObjSelector.Show()

jeff
大家好,


[引用文字剪辑 - 37行]


[quoted text clipped - 37 lines]


Mac

Mac




-

来自DotNetMonster.com的消息
http:// www.dotnetmonster.com/Uwe/For...b-net/200512/1


这篇关于拥有选项卡式MDI应用程序的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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