搜索
编程论坛
→
开发语言
→
『 Delphi论坛 』
→ [求助]数据加入求助
标题:
[求助]数据加入求助
只看楼主
avon4563
等 级:
新手上路
帖 子:17
专家分:0
注 册:2006-4-12
楼主
问题点数:0 回复次数:7
[求助]数据加入求助
窗体中,一个ListBox,一个ComboBox.我想实现双击ListBox里面某一项时,ComboBox中就添加一项,假如ComboBox里面有相同项时,该加入动作无效.
各位大虾帮眼看看,帮帮忙啊.........
搜索更多相关主题的帖子:
数据
2006-04-13 09:16
avon4563
等 级:
新手上路
帖 子:17
专家分:0
注 册:2006-4-12
第
2
楼
得分:0
我之前是这样做的,你们同时也帮我看看错哪了
if (ListBox1.Items.Strings[ListBox1.ItemIndex]=ComboBox1.Items.Strings[ComboBox1.ItemIndex]) then
exit;
ComboBox1.Items.Delete(ComboBox1.Items.Add(ComboBox1.ItemIndex));
ComboBox1.Items.Add(ListBox1.Items.Strings[ListBox1.ItemIndex]);
ComboBox1.ItemIndex := ComboBox1.Items.Count - 1;
如果我是你眼中的一颗泪珠,我会顺着你的脸庞滑落在你的双唇之间,因为我真的好想吻你!
2006-04-13 09:26
avon4563
等 级:
新手上路
帖 子:17
专家分:0
注 册:2006-4-12
第
3
楼
得分:0
上面我发多了一行:第三行
if (ListBox1.Items.Strings[ListBox1.ItemIndex]=ComboBox1.Items.Strings[ComboBox1.ItemIndex]) then
exit;
ComboBox1.Items.Add(ListBox1.Items.Strings[ListBox1.ItemIndex]);
ComboBox1.ItemIndex := ComboBox1.Items.Count - 1;
如果我是你眼中的一颗泪珠,我会顺着你的脸庞滑落在你的双唇之间,因为我真的好想吻你!
2006-04-13 09:30
avon4563
等 级:
新手上路
帖 子:17
专家分:0
注 册:2006-4-12
第
4
楼
得分:0
有没有人帮我看看问题出在哪里啊,今天星期六,应该有人回应一下了吧.
如果我是你眼中的一颗泪珠,我会顺着你的脸庞滑落在你的双唇之间,因为我真的好想吻你!
2006-04-15 08:44
yuxue1985
等 级:
新手上路
帖 子:31
专家分:0
注 册:2006-4-13
第
5
楼
得分:0
你是用的什么触发事件?
我看也没有错啊
先判断然后添加
你把你的错误说明白
2006-04-15 10:38
hanppern
等 级:
新手上路
帖 子:1
专家分:0
注 册:2006-3-31
第
6
楼
得分:0
if ComboBox1.Items.Indexof(ListBox1.Items.Strings[ListBox1.ItemIndex])=-1 then
ComboBox1.Items.add(ListBox1.Items.Strings[ListBox1.ItemIndex]);
2006-04-16 09:56
ysp_1984
等 级:
贵宾
威 望:
15
帖 子:371
专家分:0
注 册:2006-1-5
第
7
楼
得分:0
procedure TForm1.ListBox1DblClick(Sender: TObject);
var
temp:string;
begin
temp:=listbox1.Items[listbox1.itemindex];
if combobox1.Items.IndexOf(temp)=-1 then
combobox1.Items.Add(temp);
combobox1.ItemIndex:=0;
end;
心中的那片蓝天,永远为你而存在... ...
2006-04-16 13:42
avon4563
等 级:
新手上路
帖 子:17
专家分:0
注 册:2006-4-12
第
8
楼
得分:0
感谢各位的帮忙,谢谢拉
如果我是你眼中的一颗泪珠,我会顺着你的脸庞滑落在你的双唇之间,因为我真的好想吻你!
2006-04-17 08:53
8
1/1页
1
参与讨论请移步原网站贴子:
https://bbs.bccn.net/thread-57192-1-1.html
关于我们
|
广告合作
|
编程中国
|
清除Cookies
|
TOP
|
手机版
编程中国
版权所有,并保留所有权利。
Powered by
Discuz
, Processed in 1.166627 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved