发新话题
打印

VB questions

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?

TOP

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

TOP

Thanks again.

TOP

引用:
原帖由 风雨声中 于 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.

TOP

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

但接收程序,最好用窗体的控件,比如TextBox

TOP

Thanks.

TOP

发新话题