Board logo

标题: VB questions [打印本页]

作者: Joe    时间: 2006-8-1 00:38     标题: VB questions

I'm facing the following questions:

1. How to pass parameters between two or more forms?

2. How to keep the value of varibles between two or more forms?

3. How to clear the old data in screen and display /input new data in new screen?
作者: 风雨声中    时间: 2006-8-1 09:58

1. 在Form1中加入下面代码
Public bb as Long '变量可以更改
在Form2中调用使用Form1.bb即可
2.这个变量可以在模块中用Public声名
3.我不明白你的意思,你的意思是抓图吗?
作者: Joe    时间: 2006-8-1 10:40

Thanks again.
作者: Joe    时间: 2006-8-1 10:43

引用:
原帖由 风雨声中 于 2006-8-1 09:58 发表
3.我不明白你的意思,你的意思是抓图吗?
I give an example in Pascal. But how to convert it to vb?

Program example;
{This is an example program for input and output}

uses Crt;
var


name : string[30];
begin

clrscr;          {This clears the screen}
write ('What is your name? '); {Writes the question without moveing the cursor to the next line}
readln (name); {take input from user}
writeln ('Hello ', name); {Output Hello joebob}
while not keypressed do; {waits for a key to be pressed}

end.
作者: 风雨声中    时间: 2006-8-1 11:15

你是说VB的控制台编程?
VB不能直接编写控制台程序。
如果是在窗口上操作,可以用下面的代码
    Form1.Cls
    Form1.Print "What is your name"

但接收程序,最好用窗体的控件,比如TextBox
作者: Joe    时间: 2006-8-3 22:17

Thanks.




欢迎光临 编程开发论坛 (http://bbs.lihuasoft.net/) Powered by Discuz! 6.0.0