控件的使用问题求解(一)
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
DateTimePicker1.time:=time;
DateTimePicker2.time:=time;
DateTimePicker3.time:=time;
DateTimePicker4.time:=time;
DateTimePicker5.time:=time;
DateTimePicker6.time:=time;
DateTimePicker7.time:=time;
DateTimePicker8.time:=time;
DateTimePicker9.time:=time;
end;可否简单写,如果100个,岂不累死
*************************************************************************控件的使用问题求解(二)
10个EDIT与1个MEMO,要求将10EDIT中写有东西的EDIT列在MEMO中,如果某EDIT中没有写东西,则不列出来。
MEMO.LINE.ADD(EDIT1.TEXT+EDIT2.TEXT+...EDIT10.TEXT)
请问如何判断后EDIT中没有东西,并不写出来?
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
DateTimePicker1.time:=time;
DateTimePicker2.time:=time;
DateTimePicker3.time:=time;
DateTimePicker4.time:=time;
DateTimePicker5.time:=time;
DateTimePicker6.time:=time;
DateTimePicker7.time:=time;
DateTimePicker8.time:=time;
DateTimePicker9.time:=time;
end;可否简单写,如果100个,岂不累死
*************************************************************************控件的使用问题求解(二)
10个EDIT与1个MEMO,要求将10EDIT中写有东西的EDIT列在MEMO中,如果某EDIT中没有写东西,则不列出来。
MEMO.LINE.ADD(EDIT1.TEXT+EDIT2.TEXT+...EDIT10.TEXT)
请问如何判断后EDIT中没有东西,并不写出来?
解决方案 »
- cxgrid与 TcxGridPopupMenu 窗体封装到DLL中出现EConvertError的问题
- inset into 与 append的问题,各位高手指教了。
- 如何将一个字节型的指针中的所有数据转换成string显示出来?急!!!谢谢!!!
- 请问:Tcontrol 与 Tcomponent 的区别
- 自己写的Socks5代理的源码,还有些问题没有解决,请大家指教!(3)
- 能否在windows2000专业版中安装XP的远程桌面功能?
- 一个怪事,可能是我很菜的过
- 如何获得比如:http://www.download.com/sp.exe文件得大小?(不下载它)
- 高分,请教QQ实现的原理?
- 新手50分请教stringgrid问题....简单!!!
- Delphi安装的序列号是多少?
- Delphi5 代码转 C++ Builder5-6,请各位跨越这个界限的高手看看,谢谢!
var
i:integer;
begin
for i:=self.ComponentCount-1 do
if (Components[i] is TDateTimePicker) then
(Components[i] as TDateTimePicker).time:=time;
end;二、
EDIT里没有东西,当然不会写出来呀。还是我理解错了?
可判断有没有东西,两个引号间无间隔
控件的使用问题求解(二)
10个LABEL、10个EDIT与1个MEMO,要求将10EDIT中写有东西的EDIT列在MEMO中,如果某EDIT中没有写东西,则不列出来。
MEMO.LINE.ADD(LABEL1.CAPTION+EDIT1.TEXT+LABEL2.CAPTION+EDIT2.TEXT+...LABEL10.CAPTION+EDIT10.TEXT)
请问如何判断后EDIT(n)中没有东西,LABLEn.CAPTION与EDITn.TEXT不写出来.
var i:integer
begin
for i:=0 to self.ComponentCount-1 do
if (self.Components[i] is TLabeledEdit) then
if (self.Components[i] as TLabeledEdit).text <> '' then
Memo1.Lines.Add((self.Components[i] as TLabeledEdit).EditLabel.Caption+(self.Components[i] as TLabeledEdit).text);
end;
str:string;
begin
str:='';
for i:=0 to self.ComponentCount-1 do
if (Components[i] is Tedit) then
if (((Components[i] as Tedit).text:<>'') or ((Components[i] as Tedit).text:<>null)) then
str:=str+(((Components[i] as Tedit).text;
Memo1.Lines.Add(str);
end;
控件的使用问题求解(二)
10个LABEL、10个EDIT与1个MEMO,要求将10EDIT中写有东西的EDIT列在MEMO中,如果某EDIT中没有写东西,则不列出来。
MEMO.LINE.ADD(LABEL1.CAPTION+EDIT1.TEXT+LABEL2.CAPTION+EDIT2.TEXT+...LABEL10.CAPTION+EDIT10.TEXT)
请问如何判断后EDIT(n)中没有东西,LABLEn.CAPTION与EDITn.TEXT不写出来.
for i:=0 to self.ComponentCount-1 do
if (Components[i] is Tedit) then
if (((Components[i] as Tedit).text<>'') or ((Components[i] as Tedit).text<>null)) then
str1:=str+(((Components[i] as Tedit).text;
Memo1.Lines.Add(str1);
end;