DragDrop的视觉效果 [英] Visual effects with DragDrop

查看:101
本文介绍了DragDrop的视觉效果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个按钮,我想拉到标签。


我想拉动它时按钮可以移动。


当我放下标签上的按钮时,我想测试一些带有

按钮的数据 - f.ex是Button.Text =正确的!。


我有一些可以执行DragDrop效果的代码但是这段代码禁用了

视觉效果和按钮可视化移动到标签。

如何组合这两种效果,以便在拉动按钮时,它是可视的移动,当它被放在标签上时 - f.ex,Label.Text是

设置为Button.Text?


KS,丹麦

I have a Button I want to pull to a Label.

I want the Button visualy to move when I pull it.

When I drop the button on the Label I want to test some data coming with the
Button - f.ex is the Button.Text="The right one!".

I have some code that can do the DragDrop-effect BUT this code disables the
visual effect og the Button visualy moving to the Label.

How can I combine the two effects so that when the Button is pulled it is
visualy moved AND when it''s dropped on the Label - f.ex the Label.Text is
set to Button.Text ?

KS, Denmark

推荐答案

我忘记了 - 这是VB.NET 2002!


KS,丹麦
I forgot - it''s VB.NET 2002 !

KS, Denmark


嗨KS,


您可以使用其中一个计时器

(大多数情况下我不会这么说但是我觉得这个系统.forms.timer会这样做)

(您可以从窗体上的windows.form工具箱中拖动它)

将其设置为启用并将刻度设置为1或2

然后使用它来改变表格中的位置在timer.tick中取消

事件


Button1.Location =新点(IntegerX,IntegerY)


然后在你想要放手的方向上向整数添加一些东西(1就够了)

(如果你想让它弯曲,你必须要做点什么,但那只是试试。


我觉得它看起来不错?


Cor

....
Hi KS,

You can use for that one of the timers
(mostly I don''t say that but I think for this system.forms.timer will do it)
(You can drag that from the windows.form toolbox on your form)
Set it to enable and set the tick to 1 or 2
And then use that to change the position on the form do in the timer.tick
event

Button1.Location = New Point(IntegerX, IntegerY)

And add then something (1 is enough) to the Integers in the direction you
want to let it go
(you have to do something for if you want to have it curves, but that is
just trying).

I think it looks nice?

Cor
....
我有一个按钮,我想拉到标签。

当我拉动它时,我希望Button可以移动。

当我按下Label上的按钮时,我想测试一些带有
的数据Button-f.ex是Button。 Text =正确的!。

我有一些代码可以执行DragDrop效果但是此代码禁用了
的视觉效果效果og按钮可以移动到标签上。

如何组合这两种效果,这样当拉动按钮时,它是可视的,当它被放在标签上时 - f.ex将Label.Text设置为Button.Text?

KS,丹麦
I have a Button I want to pull to a Label.

I want the Button visualy to move when I pull it.

When I drop the button on the Label I want to test some data coming with the Button - f.ex is the Button.Text="The right one!".

I have some code that can do the DragDrop-effect BUT this code disables the visual effect og the Button visualy moving to the Label.

How can I combine the two effects so that when the Button is pulled it is
visualy moved AND when it''s dropped on the Label - f.ex the Label.Text is
set to Button.Text ?

KS, Denmark



感谢您的想法,但它不能很好地工作。


我希望按钮跟随鼠标指针,好像标志好像
$ b DragDrop-effect COPY的$ b被以下按钮禁用 - 复制标志

暂时可以看到...


不,它不是'看起来很不错。


KS,丹麦
Thanks for the idea but it don''t work very well.

I want the button to follow the mousepointer and it seems as though the sign
for DragDrop-effect COPY is disabled by the following button - the COPY-sign
is momentarily to see ...

No, it don''t look very nice.

KS, Denmark


这篇关于DragDrop的视觉效果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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