首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VB >

VB界面设计的有关问题~

2012-02-19 
VB界面设计的问题~~~在进行界面设计的时候,如果直接拖控件,可视化的设计界面后,代码中就不会显示这个控件

VB界面设计的问题~~~
在进行界面设计的时候,如果直接拖控件,可视化的设计界面后,
代码中就不会显示这个控件的一些属性值,比如“标题”,
有没有办法能够重新生成一次代码,使里面添加了界面的属性信息?

[解决办法]
有些属性取默认值时不在.frm中出现。
用记事本或其它文本编辑器直接编辑修改.frm文件前面的一大段Begin...End窗口元素即可。
[解决办法]

探讨
在进行界面设计的时候,如果直接拖控件,可视化的设计界面后,
代码中就不会显示这个控件的一些属性值,比如“标题”,
有没有办法能够重新生成一次代码,使里面添加了界面的属性信息?

[解决办法]
除非LZ的VB有问题,我将LZ帖出的代码部分做了个实验工程,将4个按钮的Caption都命名为与其在代码中Name属性一样,记事本打开,仍能看到控件的Caption数据信息.
VB code
VERSION 5.00Begin VB.Form Form1    Caption         =   "Form1"   ClientHeight    =   3090   ClientLeft      =   60   ClientTop       =   450   ClientWidth     =   4680   LinkTopic       =   "Form1"   ScaleHeight     =   3090   ScaleWidth      =   4680   StartUpPosition =   3  '窗口缺省   Begin VB.CommandButton cmdPrintAll       Caption         =   "cmdPrintAll"      Height          =   495      Left            =   3240      TabIndex        =   3      Top             =   2055      Width           =   1215   End   Begin VB.CommandButton cmdPrint       Caption         =   "cmdPrint"      Height          =   495      Left            =   3255      TabIndex        =   2      Top             =   1455      Width           =   1215   End   Begin VB.CommandButton cbNext       Caption         =   "cbNext"      Height          =   495      Left            =   3255      TabIndex        =   1      Top             =   840      Width           =   1215   End   Begin VB.CommandButton cbExit       Caption         =   "cbExit"      Height          =   495      Left            =   3255      TabIndex        =   0      Top             =   210      Width           =   1215   EndEndAttribute VB_Name = "Form1"Attribute VB_GlobalNameSpace = FalseAttribute VB_Creatable = FalseAttribute VB_PredeclaredId = TrueAttribute VB_Exposed = FalseOption ExplicitPrivate Sub cbExit_Click()frmInstructionsP1.HideEnd SubPrivate Sub cbNext_Click()frmInstructionsP1.HidefrmInstructionsP2.ShowEnd SubPrivate Sub cmdPrint_Click()PrintFormEnd SubPrivate Sub cmdPrintAll_Click()frmInstructionsP1.PrintFormfrmInstructionsP2.PrintFormfrmInstructionsP3.PrintFormfrmInstructionsP4.PrintFormfrmInstructionsP5.PrintFormfrmInstructionsP6.PrintFormfrmInstructionsP7.PrintFormfrmInstructionsP8.PrintFormfrmInstructionsP9.PrintFormfrmInstructionsP10.PrintFormfrmInstructionsP11.PrintFormEnd Sub
[解决办法]
是啊,而且你是发在基础类,又不是发在VBA版,唉,我来"移动"一下吧:)

热点排行