📄 vb0002.htm
字号:
<HTML>
<head><title>洪恩在线 - 认识一下VB 6.0的编程环境</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<META HTTP-EQUIV="Pragma" CONTENT="no_cache">
<link rel="stylesheet" href="/pub/css/home.css">
<link rel="stylesheet" href="/pc/program/program.css">
<meta name="keywords" content="程序设计,编程入门,VB,教程,电脑,教育,电脑乐园,交互">
<script language="javascript">
<!--
function change(myform)
{
var url="www.hongen.com/pc/program/index.htm";
url=myform.select.options[myform.select.options.selectedIndex].value;
top.location.href=url;
}
//-->
</script></head>
<body bgcolor="#FFFFFF">
<!--顶部开始-->
<script language=javascript src=/pub/js/head.js></script>
<!--顶部结束-->
<table width="760" height="20" border=0 cellspacing="0" cellpadding="0" align="center">
<tr valign="middle" align="left">
<td height=20 class="p1" width="297" bgcolor="#D3E7FF" align=center><div align="left"> <a href="/pc/program/index.htm" class=under>程序设计栏目首页</a></div></td>
<td align=left class="p1" height="20" width="58" valign="top"><img src="/pc/program/img/leftnew-0.gif" width="52" height="20"></td>
<td align="right" class="p1" height="20" width="405"><font color="#330099">当前位置:<a href="/default.htm" class="under">洪恩在线</a>
-> <a href="/pc/index.htm" class="under">电脑乐园</a> -> 认识一下VB 6.0的编程环境</font><img name="image2" src="/pc/img/blank.gif" width="8" height="8">
</td>
</tr>
</table>
<table width=760 border=0 align="center" cellspacing="0" cellpadding="0">
<tr>
<td height=15><img src="/pc/img/blank.gif" width="1" height="1" border=0></td>
</tr>
</table>
<table width="760" border="0" cellspacing="0" cellpadding="0" align="center" height="909">
<tr>
<th width="150" bgcolor="6082CF" align="center" height="910" valign="top"> <!-- 左边条开始 --> <script language="Javascript" src="/pc/program/js/proleft.js"></script> <!-- 左边条结束 --><p align="center" class=p1> <a href=/pc/bin/msg.pl?file_id=k_tutor_vb target="_blank"><img src="/pc/img/message.gif" width="64" height="54" alt="请您留言" border="0"><br> 谈谈您的看法</a> <br> <script language="javascript">speak_num="za"</script> <script language="javascript" src=/pc/var/pc_k_tutor_vb.js></script> <script language="javascript">var num=0if (!isNaN(speak_num)){ num=speak_num;}else{ num=0}document.writeln ("已有")document.writeln (num)document.writeln ("条发言")</script></p>
<br>
</th>
<td bgcolor="#000000" width="1" height="910"><img src="/pc/img/blank.gif" width="1" height="1"></td>
<td valign="top" align="center"> <br>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
<td width="13" valign="middle"><img src="/pc/program/img/dot.gif" width="13" height="13"></td>
<td class="p2" width="150" align="center" valign="middle"><font color="B85959"><b>编
程 入 门</b></font></td>
<td width="179"><img src="/pc/program/img/logo2.gif" width="179" height="52"></td>
</tr>
</table>
<table width="95%" border="0" cellspacing="0" cellpadding="0" class="p2">
<tr>
<td height="15" valign="bottom" class="p2">--看实例学VB 6.0--<b>认识一下VB 6.0的编程环境--</b></td>
<td height="15" valign="bottom" class="p2">
<div align="right" class="p1"><a href="/pc/program/tutors/vb/vb0003.htm">下一节</a></div>
</td>
</tr>
<tr>
<td bgcolor="FF9700" height="1" ><img src="img/blank.gif" width="1" height="2"></td>
<td bgcolor="FF9700" height="1" ><img src="img/blank.gif" width="1" height="2"></td>
</tr>
</table>
<table width="95%" border="0" cellspacing="0" cellpadding="0" class="p2" background="/pc/img/line.gif">
<tr>
<td class="p2" height="120" colspan="4">
<p align="left"><span class="p2" style="line-height:17pt"> VB6.0采用可视化的编程环境,它好学易用,运行VB6.0后,会出现如下图所示的窗口,呵呵,看起来蛮复杂的,好多的按钮、菜单、小窗口,别担心,待会儿我们会一起学习这些东东都是干什么用的。</span></p>
<p align="left"><span class="p2" style="line-height:17pt"> 先来解决一个小问题,怎么新建一个VB的工程呢?方法是这样的,在程序启动时出现的“新建工程”对话框中选择“标准EXE”并点击确定,就能直接新建一个工程,如果你跳过了这个对话框则也可从“文件”菜单中选择“新建工程”重新调出此对话框。</span></p>
<p align="left"><span class="p2" style="line-height:17pt"> 下面一起来看看VB的编程环境,虽然看起来复杂,但可以把它分为几个部分,每个部分都有自己特定的功能,这样我们就清楚多了。其实VB这是通过这样一个界面把相近或同类的功能组合在一起的,它使我们在设计程序时能方便的控制程序的方方面面。</span></p>
<p align="left"><img src="img/vbfull.gif" width="580" height="411"><br>
</p>
<p align="left"><span class="p2" style="line-height:17pt"> 窗体的最上层是“VB 6.0的菜单”和“便捷工具按钮”,菜单中包含了所有的VB提供的功能的选项,而其中一些常用的功能或操作选项则被提取出来放在了“便捷工具按钮”中,通过点击这些快捷按钮可以加快程序开发的速度,下图标出了常见的工具按钮的作用,记着使用它们哦。</span></p>
<p align="center"><img src="img/toolbar.gif" width="577" height="80"></p>
<p align="left"><span class="p2" style="line-height:17pt"> 接着看看“VB的组件面板”和“窗体设计区域”,VB提供了方便的窗体设计区域,它位于整个编程窗口的中间。我们可以在这个区域中搭建出美观实用的程序界面,试着从“VB的组件面板”中找到“按钮CommandButton”,点击选中后,再到“窗体设计区域”的窗体上点一下,这时,窗体上会出现一个按钮,这样我们就把按钮添加到我们程序的界面中了。嘻嘻,忘了告诉你哪里是“VB的组件面板”了,就是最左边的那一条包含许多看起来眼熟的小东西的区域,它是VB提供给我们的标准的编程组件(控件),它把程序设计中常常用到的诸如按钮、图片框、列表框等等东西作好了放在那里,我们如果要使用只须添加到窗体中即可。
</span></p>
<p align="left"><span class="p2" style="line-height:17pt"> 屏幕的右边有三个从上到下排列的小窗口,它们分别是:</span></p>
<p align="left"><span class="p2" style="line-height:17pt"><img src="img/proman.gif" width="205" height="202" align="left" hspace="40"> “VB工程管理器”:用来管理开发一个VB程序所需要的各种类型的窗体和模块,如左图是一个工程所包含的东西,窗体是一个程序表现在外面的界面、模块是程序内部使用的代码。</span></p>
<p align="left"><span class="p2" style="line-height:17pt"> 当我们点击“添加窗体”便捷工具按钮后,左图的“VB工程管理器”中就会显示出新添加的窗体,这也就是“VB工程管理器”的功能,它使我们从总体上把握程序开发的各个部分。</span></p>
<p align="left"><span class="p2" style="line-height:17pt"><img src="img/property.gif" width="206" height="253" align="right" hspace="40"></span></p>
<p align="left"> </p>
<p align="left"><span class="p2" style="line-height:17pt"> “组件属性窗口”:用来显示组件的属性,并允许我们修改,设定这些属性的值,我们在窗体设计区域的窗体上选中一个组件,以按钮为例,则在“属性窗口”中会列出它的属性,我们可以看到常用的“Name”、“Capition”、“Font”等等属性,试着把“Capition”属性改为“这是一个按钮”,然后看看“窗体设计区域”的按钮上显示的文字是不是改变了。</span></p>
<p align="left"> </p>
<p align="left"><span class="p2" style="line-height:17pt"><img src="img/arrange.gif" width="201" height="197" align="left" hspace="40"></span></p>
<p align="left"><span class="p2" style="line-height:17pt"><br>
“窗体布局窗口”:调整程序运行时,程序窗体在屏幕中的初始位置,把鼠标移到左图屏幕中的窗体上,这时鼠标会变成移动形状,拖动窗体,就设置好了运行时此窗体的位置。</span></p>
<p align="left"><span class="p2" style="line-height:17pt"> 好了说了这么多,还差一个区域没讲,那就是“代码编辑区域”,当我们在“窗体设计区域”双击鼠标,就能弹出这个区域,可以看到一行行的VB程序显示在其中,我们可以修改,写入程序代码,来让程序实现一定的功能,它是整个程序设计的关键,如果你对VB语言的语法还不是十分了解,可以继续下一节专门对“VB语法”的讲解,别着急,慢慢来,很快就能入门的。
</span></p>
</td>
</tr>
<tr>
<td bgcolor="FF9700" height="2" width="5%"><img src="/pc/img/blank.gif" width="1" height="2"></td>
</tr>
</table>
<table width="95%" align="center" class="p1" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="16%">
<div align="center"><a href="/pc/program/index.htm">程序设计首页</a></div>
</td>
<td width="16%">
<div align="center"><a href="/pc/program/tutors/index.htm" color="#009999">编程入门首页</a></div>
</td>
<td width="41%">
<div align="left">相关链接: <a href="/pc/program/codtutor/index.htm">VB趣味程序讲解</a></div>
</td>
<td width="16%">
<div align="right"><a href="/pc/program/tutors/vb/vb0001.htm">上一节</a> <a href="/pc/program/tutors/vb/vb0003.htm">下一节</a></div>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!--底部开始-->
<script language="Javascript" src="/pub/js/foot.js"></script>
<!--底部结束--></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -