是否有完成调整大小的事件? [英] Is there a done resizing event ?

查看:38
本文介绍了是否有完成调整大小的事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个从UserControl派生的新控件。

我需要在控件调整大小时获得一个事件。


我尝试过Resize,SizeChanged,Move和Layout事件我也尝试了

来覆盖它们。但是当控件处于调整大小过程的中间时,它们都会调用。


我没有使用断点,我正在使用跟踪看看哪一个被调用了?

什么时候。


是否有一个事件只是告诉我什么时候调整大小?

---------

谢谢

Sharon

I''m writing a new control derived from UserControl.
I need to get an event when the control is done resizing.

I tried the Resize, SizeChanged, Move and the Layout events and I also tried
to override them. But they all invoked when the control is in the middle of
the resizing process.

I''m not using breakpoints, I''m using trace to see which one is invoked and
when.

Is there an event that simply tells me when the resizing is done ?
---------
Thanks
Sharon

推荐答案

你好,

如果用鼠标调整窗口大小,你可以将鼠标加重

事件结束调整大小。

我希望帮助你。


-Ab。
http ://joehacker.blogspot.com


" Sharon" <嘘***** @ newsgroups.nospam>在消息中写道

新闻:E3 ********************************** @ microsof t.com ...
Hi,
In case the window is being resized with a mouse, you can treat a mouseup
event to be end of resizing.
I hope that helps u.

-Ab.
http://joehacker.blogspot.com

"Sharon" <Sh*****@newsgroups.nospam> wrote in message
news:E3**********************************@microsof t.com...
我正在编写一个从UserControl派生的新控件。
我需要在控件调整大小时得到一个事件。
我尝试了Resize,SizeChanged,Move和Layout事件,我还试图覆盖它们
。但是当控件位于调整大小过程的
中间时,它们都被调用。

我没有使用断点,我正在使用跟踪来查看调用哪一个并且<当/。
是否有一个事件只是告诉我何时完成调整大小?

---------
谢谢<沙龙
I''m writing a new control derived from UserControl.
I need to get an event when the control is done resizing.

I tried the Resize, SizeChanged, Move and the Layout events and I also tried to override them. But they all invoked when the control is in the middle of the resizing process.

I''m not using breakpoints, I''m using trace to see which one is invoked and
when.

Is there an event that simply tells me when the resizing is done ?
---------
Thanks
Sharon



看起来这是一个好主意,但它可能对表格有好处,但我需要它

我正在写的控件。

我会解释:

我正在写的控件不能单独调整大小,它通过调整其父表单的大小来调整

的大小。

(表单设置我的控件Dock = None,Anchor = Top,Left,Right)。

因此,当用户完成表单大小调整时,MouseUp位于表单上下文

和控件中。

我试图设置Parent.MouseUp(其中Parent是Form)事件,但是没有被解雇是




所以我会很高兴听到更多的想法。

----------

谢谢

Sharon

-

谢谢

Sharon

" abubakar"写道:
It looks like a good idea, but it''s may be good for Forms, but I need it for
the control that I''m writing.
I''ll explain:
The control that I''m writing can no be resized separately, it''s being
resized by resizing its parent Form.
(The Form is setting my control Dock = None, Anchor = Top,Left,Right).
So when the user done resizing the Form, the MouseUp is in the Form context
and of the control.
I tried to set Parent.MouseUp (where Parent is the Form) event, but it is
not being fired.

So I''ll be very happy to hear any more Ideas.
----------
Thanks
Sharon
--
Thanks
Sharon
"Abubakar" wrote:

如果用鼠标调整窗口大小,你可以将鼠标挂起的事件视为调整大小的结束。
我希望能帮助你。

-Ab。
http: //joehacker.blogspot.com

沙龙 <嘘***** @ newsgroups.nospam>在消息中写道
新闻:E3 ********************************** @ microsof t.com。 ..
Hi,
In case the window is being resized with a mouse, you can treat a mouseup
event to be end of resizing.
I hope that helps u.

-Ab.
http://joehacker.blogspot.com

"Sharon" <Sh*****@newsgroups.nospam> wrote in message
news:E3**********************************@microsof t.com...
我正在编写一个从UserControl派生的新控件。
我需要在控件调整大小时得到一个事件。

我试过了调整大小,SizeChanged,移动和布局事件,我也
I''m writing a new control derived from UserControl.
I need to get an event when the control is done resizing.

I tried the Resize, SizeChanged, Move and the Layout events and I also


尝试

来覆盖它们。但是当控件位于
to override them. But they all invoked when the control is in the middle
调整大小过程的中间

时,它们都会调用。

我没有使用断点,我我正在使用跟踪来查看哪一个被调用了什么时候。

是否有一个事件只是告诉我什么时候调整大小?

--- ------
谢谢
Sharon

the resizing process.

I''m not using breakpoints, I''m using trace to see which one is invoked and
when.

Is there an event that simply tells me when the resizing is done ?
---------
Thanks
Sharon




以下代码适用于visual studio 2k5:


private void UserControl1_Load(object sender,EventArgs e)

{

((Form)this.Parent)。 ResizeEnd + = new EventHandler(UserControl1_ResizeEnd);

}

void UserControl1_ResizeEnd(object sender,EventArgs e)

{

MessageBox.Show(" Resize end");

}


我希望有所帮助。


-Ab。
http://joehacker.blogspot.com

" Sharon" <嘘***** @ newsgroups.nospam>在消息中写道

新闻:A8 ********************************** @ microsof t.com ...
The following code works in visual studio 2k5:

private void UserControl1_Load(object sender, EventArgs e)
{
((Form)this.Parent).ResizeEnd += new EventHandler(UserControl1_ResizeEnd);
}
void UserControl1_ResizeEnd(object sender, EventArgs e)
{
MessageBox.Show("Resize end");
}

I hope that helps.

-Ab.
http://joehacker.blogspot.com

"Sharon" <Sh*****@newsgroups.nospam> wrote in message
news:A8**********************************@microsof t.com...
这看起来是一个好主意,但它对于Forms可能有用,但是我需要
来表示我正在编写的控件。
我会解释:
我正在写的控件不能单独调整大小,通过调整其父窗体的大小来调整它的大小。
(表单设置我的控件Dock = None,Anchor = Top,Left,Right)。
因此,当用户完成表单大小调整时,MouseUp位于Form
上下文和控件中。
我尝试设置Parent.MouseUp(其中Parent是Form)事件,但它没有被解雇。

所以我会很高兴听到更多的想法。

----------
谢谢
Sharon
-
谢谢
Sharon

阿布巴卡尔写道:
It looks like a good idea, but it''s may be good for Forms, but I need it for the control that I''m writing.
I''ll explain:
The control that I''m writing can no be resized separately, it''s being
resized by resizing its parent Form.
(The Form is setting my control Dock = None, Anchor = Top,Left,Right).
So when the user done resizing the Form, the MouseUp is in the Form context and of the control.
I tried to set Parent.MouseUp (where Parent is the Form) event, but it is
not being fired.

So I''ll be very happy to hear any more Ideas.
----------
Thanks
Sharon
--
Thanks
Sharon
"Abubakar" wrote:

如果用鼠标调整窗口大小,你可以将
mouseup事件视为调整大小的结束。
我希望能帮助你。

-Ab。
http: //joehacker.blogspot.com

沙龙 <嘘***** @ newsgroups.nospam>在消息中写道
新闻:E3 ********************************** @ microsof t.com。 ..
Hi,
In case the window is being resized with a mouse, you can treat a mouseup event to be end of resizing.
I hope that helps u.

-Ab.
http://joehacker.blogspot.com

"Sharon" <Sh*****@newsgroups.nospam> wrote in message
news:E3**********************************@microsof t.com...
我正在编写一个从UserControl派生的新控件。
我需要在控件调整大小时得到一个事件。

我试过了调整大小,SizeChanged,移动和布局事件,我也
I''m writing a new control derived from UserControl.
I need to get an event when the control is done resizing.

I tried the Resize, SizeChanged, Move and the Layout events and I also


尝试

来覆盖它们。但是当控件位于
to override them. But they all invoked when the control is in the middle
的大小调整过程中时,它们都会调用。

我没有使用断点,我正在使用trace查看哪一个被调用
the resizing process.

I''m not using breakpoints, I''m using trace to see which one is invoked



以及何时。
<是否有一个事件只是告诉我何时完成调整大小?

---------
谢谢
Sharon


and when.

Is there an event that simply tells me when the resizing is done ?
---------
Thanks
Sharon




这篇关于是否有完成调整大小的事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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