| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 840 人关注过本帖
标题:[求助]Delphi中窗体调用的问题
只看楼主 加入收藏
jimzzq
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2006-5-4
收藏
 问题点数:0 回复次数:2 
[求助]Delphi中窗体调用的问题
小弟刚刚开始接触Delphi,现在在进行练习中,我做一个简单的WinForm的对话框设计中碰到问题。
程序有两个简单的窗体WinForm,WinForm1。其中WinForm1被命名为AboutBox,且FormBorderStyle属性为FixedDialog,ControlBox,MinimizeBox和MaxmizeBox属性都是False。主窗体WinForm通过点击一个菜单项来调用显示WinForm1,可是在运行时主窗体的程序中老是出现不能识别AboutBox的错误,这是为什么啊??是否是主窗体在调用WinForm1的时候要在程序段中加以编写或者用uses之类的??请各位帮帮忙,我之前的练习也有过类似的毛病。
一下是两个窗体中的额部分程序段,请各位帮我看看吧。谢谢!!

报错点是:《《《《《《《----------
出错提示:undeclared identified:'AboutBox'

主窗体 WinForm:
unit WinForm;

interface

uses
System.Drawing, System.Collections, System.ComponentModel,
System.Windows.Forms, System.Data;

type
TWinForm = class(System.Windows.Forms.Form)
{$REGION 'Designer Managed Code'}
strict private
/// <summary>
/// Required designer variable.
/// </summary>
Components: System.ComponentModel.Container;
MainMenu1: System.Windows.Forms.MainMenu;
mnu_about : System.Windows.Forms.MenuItem;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure InitializeComponent;
procedure mnu_About_Click(sender: System.Object; e: System.EventArgs);
{$ENDREGION}
strict protected
/// <summary>
/// Clean up any resources being used.
/// </summary>
procedure Dispose(Disposing: Boolean); override;
private
{ Private Declarations }
public
constructor Create;
end;
............
............
procedure TWinForm.mnu_About_Click(sender: System.Object; e: System.EventArgs);
var
box : AboutBox; 《《《《《《《----------
begin
box := AboutBox.Create;
box.ShowDialog;
end;


子窗体 WinForm1:
unit WinForm1;

interface

uses
System.Drawing, System.Collections, System.ComponentModel,
System.Windows.Forms, System.Data;

type
AboutBox = class(System.Windows.Forms.Form)
{$REGION 'Designer Managed Code'}
strict private
/// <summary>
/// Required designer variable.
/// </summary>
Components: System.ComponentModel.Container;
Label1: System.Windows.Forms.Label;
Button1: System.Windows.Forms.Button;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure InitializeComponent;
procedure Button1_Click(sender: System.Object; e: System.EventArgs);
{$ENDREGION}
strict protected
/// <summary>
/// Clean up any resources being used.
/// </summary>
procedure Dispose(Disposing: Boolean); override;
private
{ Private Declarations }
public
constructor Create;
end;
搜索更多相关主题的帖子: Delphi 窗体 
2006-05-05 10:13
kelehaha5
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2006-3-15
收藏
得分:0 
你这贴的是什么码?~~~!!!

2006-05-05 10:31
小茶
Rank: 1
等 级:新手上路
帖 子:14
专家分:0
注 册:2006-2-27
收藏
得分:0 
检查一下你所添加的调用语句以及添加的位置是否正确,如果均正确,则点击运行后会有提示添加的语句,确定后再次运行就可以了。

语句为:aboutbox.show;
添加处:被调用窗体的菜单项点击处
2006-05-05 17:59
快速回复:[求助]Delphi中窗体调用的问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023342 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved