创建动态标签 [英] Creating a dynamic Label

查看:52
本文介绍了创建动态标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这很烦人,但我正在尝试找出最佳方法.因此,通过按按钮创建标签,我改变了主意,在窗体的左上角有一个标签,并且每当我将其拖动到诸如imagebox之类的控件上时,我都希望它创建一个新标签.我在这里遇到2个问题

1-如何通过在对象上拖动标签来动态创建标签

1-如何在拖放事件上创建标签本身,因为我只获得文本属性,而没有标签本身

2-如何将Dragdrop应用于创建的新标签?

I know this is getting annoying but I am trying to figure out the best way to do this. So Creating labels from a button press, I changed my mind to have a label on the left hand corner of the form and whenever I drag it on a control such as imagebox I want it to create a new label. I got 2 problems here

1- How do i create a label on the fly by dragging a label on an object

1- How do I create a label itself on a dragdrop event cuz I only get text attribute but not the label itself

2- How do i apply dragdrop to the new labels created?

推荐答案

尝试将其添加到表单的控件集合中,并记住设置z-标签的顺序高于图像框的z顺序
Try adding it to the form''s control collection instead, and remember to set the z-order of the label higher than the z-order of the Imagebox


这篇关于创建动态标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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