[delphi基础控件]TBXCombobox切换标签时出错,求助
时间:2011-09-05
来源:互联网
如图,想做一个切换视图的功能
,
但是在切换时会报错,截图如下:
切换事件的代码如下:
Delphi(Pascal) code
请问各位,错在哪里?如何改正?
,
但是在切换时会报错,截图如下:
切换事件的代码如下:
Delphi(Pascal) code
procedure TForm1.tbxcmbxtmviewChange(Sender: TObject; const Text: string); var l_tab : TTabSheet; I : Integer; l_iniFile : Tinifile; l_name : string; l_gender : string; l_birthday : string; l_hobby : string; l_intro : string; l_age : integer; gendertemp : Integer; begin if tbxcmbxtmview.Text = '树状视图' then begin if pgc1.ActivePageIndex <> -1 then pgc1.Free; RichTreeView.Show; mmo.Show; TBXSplitter.Show; end else begin RichTreeView.Hide; mmo.Hide; TBXSplitter.Hide; mmopgc.Show; pgc1.Show; strList := TStringList.Create; l_iniFile := TiniFile.Create(FileNames); l_iniFile.ReadSections(strList); for I := 0 to strList.Count - 1 do begin l_tab := TTabSheet.Create(pgc1); l_tab.Parent := pgc1; l_tab.Align := alClient; l_tab.Caption := strList[I]; l_tab.PageControl := pgc1; mmopgc.Parent := l_tab; mmopgc.Align := alClient; mmopgc.Clear; l_name := l_iniFile.ReadString(strList[I], 'name', ''); gendertemp := l_iniFile.ReadInteger(strList[I], 'gender', 0); if gendertemp = 0 then l_gender := '男' else l_gender := '女'; l_age := l_iniFile.ReadInteger(strList[I], 'ege', 0); l_birthday := l_inifile.ReadString(strList[I], 'birthday', ''); l_hobby := l_inifile.ReadString(strList[I], 'hobby', ''); l_intro := l_inifile.ReadString(strList[I], 'introduction', ''); mmopgc.Clear; mmopgc.Lines.Add('姓名:'+l_name + #13#10 + '年龄:'+IntToStr(l_age)+ #13#10 +'性别:'+l_gender +#13#10+ '生日: '+ l_Birthday + #13#10 +'爱好:'+l_hobby +#13#10 + '介绍:'+ l_intro); mmopgc.Lines.Add(FileNames); l_inifile.Free; end; strList.Free; l_inifile.Free; end; end;
请问各位,错在哪里?如何改正?
作者: hhkun0120 发布时间: 2011-09-05
Delphi(Pascal) code
循环没结束,l_inifile被释放
这就是造成这个问题的原因。
mmopgc.Lines.Add(FileNames);
l_inifile.Free;
循环没结束,l_inifile被释放
这就是造成这个问题的原因。
作者: hhkun0120 发布时间: 2011-09-05
相关阅读 更多
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28