写的一个多选框弹出的 全部变量定义为 taste可是不知道那个地方出错了 高手给点指点
taste:='';
if checkbox1.Checked then
if taste='' then
taste:=checkbox1.Caption
else
taste:=taste+'、'-checkbox1.Caption;
taste:='';
if checkbox1.Checked then
if taste='' then
taste:=checkbox1.Caption
else
taste:=taste+'、'-checkbox1.Caption;
解决方案 »
- 用DBGrid显示多集合数据,运行时也通过,但是就是不在DBgrid中显示?
- (紧急求助)我使用DBGrid,然后对某一列采用下拉列表,选中某一项,操作完毕后,怎么将数据保存到数据库中呢?
- toolbar上有个按钮,上面有图像,设计的时候可见,为什么运行的时候那个图像却没有了呢?
- 请问如何在delphi中使用windows的API函数?
- 关于鼠标图形显示的问题
- 关于MDI的问题,分数不是问题
- 那位高手精通ReportMachine做报表
- 问个关于线程的问题
- 怎样连接Access2000数据库速度最快?
- 没分了,请大家帮忙!
- 关于动态地增加或减少选单项的问题?
- jinjazz 大哥在吗?麻烦您进来帮我解决一下这个SQL问题,小弟万分感谢!
taste:=taste+'、'-checkbox1.Caption;//-是什么意思
taste:=taste+'、-'+checkbox1.Caption;//这样试一下
unit Unit1;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls;type
TForm1 = class(TForm)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
RadioButton1: TRadioButton;
RadioButton2: TRadioButton;
GroupBox1: TGroupBox;
CheckBox1: TCheckBox;
CheckBox2: TCheckBox;
CheckBox3: TCheckBox;
CheckBox4: TCheckBox;
CheckBox5: TCheckBox;
CheckBox6: TCheckBox;
RadioGroup1: TRadioGroup;
Button1: TButton;
Edit1: TEdit;
procedure RadioButton1Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure CheckBox1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;
sex,taste:string ;
implementation{$R *.dfm}procedure TForm1.RadioButton1Click(Sender: TObject);
begin
if radiobutton1.Checked then
sex:='男'
else if radiobutton2.Checked then
sex:='女' ;end;procedure TForm1.Button1Click(Sender: TObject);
begin
showmessage(sex) ;
end;procedure TForm1.CheckBox1Click(Sender: TObject);
begin taste:='';
if checkbox1.Checked then
if taste='' then
taste:=checkbox1.Caption
else
taste:=taste+'、'-checkbox1.Caption ;
if checkbox2.Checked then
if taste='' then
taste:=checkbox2.Caption
else
taste:=taste+'、'-checkbox2.Caption ;
if checkbox3.Checked then
if taste='' then
taste:=checkbox3.Caption
else
taste:=taste+'、'-checkbox3.Caption ;
if checkbox4.Checked then
if taste='' then
taste:=checkbox4.Caption
else
taste:=taste+'、'-checkbox4.Caption ;
if checkbox5.Checked then
if taste='' then
taste:=checkbox5.Caption
else
taste:=taste+'、'-checkbox5.Caption ;
if checkbox6.Checked then
if taste='' then
taste:=checkbox6.Caption
else
taste:=taste+'、'-checkbox6.Caption ;
这是全部代码 不知道为什么.你那个方法编译之后提示致命错误 不知道什么原因哦