控件的拖曳
来源:互联网 发布:初级程序员考试大纲 编辑:程序博客网 时间:2024/05/16 04:36
这是一个从ListBox控件拖曳内容至Panel控件的动作
其中S1DragOver和S1DragDrop事件都是Panel控件的,PortList为ListBox控件,设置其属性DragMode=dmAutomatic
//设置数据源控件procedure TForm1.S1DragOver(Sender, Source: TObject; X, Y: Integer; State: TDragState; var Accept: Boolean);begin //设定能接受的控件 if TObject(Source)=PortList then Accept := True;end;//鼠标提起事件procedure TForm1.S1DragDrop(Sender, Source: TObject; X, Y: Integer);var i,j,z:Integer;begin z:=PortList.ItemIndex; if z<0 then Exit; //将串口列表选中的值赋予串口窗口 for i:=1 to PortNum do begin if TWinControl(Sender).Name='S'+InttoStr(i) then begin (FindComponent('U'+InttoStr(i)) as TRzGroupBox).Caption:=PortList.Items.Strings[z]; TRzPanel(FindComponent('S'+InttoStr(i))).Caption:='Port OK'; Break; end; end; //若此串口值被其他窗口占用,则清除其值 for j:=1 to PortNum do begin if (j<>i) and ((FindComponent('U'+InttoStr(j)) as TRzGroupBox).Caption=PortList.Items.Strings[z]) then begin (FindComponent('U'+InttoStr(j)) as TRzGroupBox).Caption:=''; TRzPanel(FindComponent('S'+InttoStr(i))).Caption:='Port Nil'; end; end;end;
0 0
- 控件的拖曳
- web鼠标拖曳控件
- 鼠标拖动(移动、拖曳)控件
- JTree的拖曳
- grid的行拖曳
- 解释ASP.NET中用户控件UserControl不能被拖曳大小的原因
- 【jQuery基础编程】jQuery-UI实现折叠面板里的控件拖曳
- iTouchSlide--一个触屏及pc端手动拖曳的图片轮换控件
- js实现简单的拖曳
- H5的拖曳效果示例
- 功能强大的悬浮拖曳视图
- 用Javascript实现拖曳ListBox中拖曳的功能
- AJAX 的DragPanelExtender 拖曳控件使用,并保存位置(此方法思路可将坐标保存到数据库)
- 精简+注释后的igoogle拖曳代码
- flex中拖曳组件的几个属性
- MFC如何实现文件的拖曳?
- qt中关于拖曳类的理解
- AJAX draggable实现的拖曳效果
- elastic-job动态添加定时任务
- Codeforces 460C Present 二分+前缀和
- detected problems with app native libraries
- 十六进制字符串转中文
- mvn库强制更新
- 控件的拖曳
- laravel5.1自定义常量的配置和使用
- 如何居中正常元素、浮动元素以及绝对定位元素
- Error:Error converting bytecode to dex:
- Linux I2C core
- php 设计模式之工厂模式
- Linux文件类型、属性
- 清园 沉没的Atlantis redis.conf配置详细解析
- WebView控件的使用