我在VB的第一个程序 [英] My first program in VB

查看:69
本文介绍了我在VB的第一个程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨人.....这是我在VB中的第一个程序。

在此之前我用C,C ++编程。

我读了一些VB黑皮书的章节;但是在初始部分本身仍然存在问题。

该程序是我必须采用任何形式的数字;八进制,二进制或十六进制以用户要求的形式转换它并显示结果。

用程序逻辑完成;但有问题..

Hi people..... this is my first program in VB.
Before this i have done programming in C,C++.
I read some of the chapters from Black book of VB; but still having problem in the initial part itself.
The program is I have to take a number in any of the forms; Octal, binary or hexadecimal convert it in the form required by user and display the result.
Am done with the logic of program; but having problems..

展开 | 选择 | Wrap | 行号

推荐答案

对不起,伙计们,我很困难,你弄错了;我忘了写然后

但你仍然可以告诉我使用不同的程序是什么;当我们点击任何一个控件时我们得到了什么?

我的意思是他们是私人的吗?还是公众?它们是否被排除在其他代码之外?

如果我们不制作它们怎么办?
Sorry folks, i troubled u i got the mistake; i had forgotten to write THEN.
But u can still tell me what''s the use of different procedures; which we get when we click any of the controls?
I mean are they private? or public? Are they excluded from other code?
What if we dont make them?



对不起伙计,我有困难我弄错了;我忘了写然后

但你仍然可以告诉我使用不同的程序是什么;当我们点击任何一个控件时我们得到了什么?

我的意思是他们是私人的吗?还是公众?他们被排除在其他代码之外吗?

如果我们不制作它们怎么办?
Sorry folks, i troubled u i got the mistake; i had forgotten to write THEN.
But u can still tell me what''s the use of different procedures; which we get when we click any of the controls?
I mean are they private? or public? Are they excluded from other code?
What if we dont make them?



在visual basic中,当你只需双击一个控件时,它会自动进入代码窗口,为你点击的控件的基本事件创建程序。例如,如果双击命令按钮,它会创建一个Command1_Click过程,因为click是一个将在命令按钮上执行的最常见事件。如果你想要一些其他事件,你可以在代码窗口中选择。


此功能使开发人员的任务变得更容易。如果您不想在创建的过程中写任何内容,只需保留它或者如果您仍然觉得烦人的删除它。(尽量不要双击任何不必要的控件在设计时间)。


既然你是初学者,你可能会觉得这很烦人,但是一旦你参与了visual basic,你真的很喜欢这个功能 - 它可以节省你的时间!


请记住visual basic执行事件驱动编程。

In visual basic,when you just double-click a control,it automatically enters the code window creating the procedure for the basic event of the control you clicked..for example,if you double click command button,it creates a procedure Command1_Click,because click is the most usual event one will perform on a command button.if you want some other event you can choose in the code window.

This feature makes the task of developers easier.If you dont want to write anything inside the created procedure,just leave it or if you still feel annoying delete it.(Try not to double click any of the unnecessary controls in design time).

Since you are a beginner,you may feel this annoying,but once you get involved with visual basic,you''d really love this feature-it saves your time!

Remember visual basic does an event driven programming.


它是相同的程序;我需要将一个数字从一个数字系统转换为另一个数字......对于不同变量的范围有点困惑。

这是我在Microsoft Visual Basic 6.0中编写的程序;现在它只有3个选项,并且也将一个数字从一个转换为相同数量的系统..实际上并没有转换..但它没有在text2中显示任何内容。

这是代码。我不知道我将如何复制VB的形式。


Public Sub Text1_Change()

静态整数作为整数

inno = Text1 .Text

结束子


Public Sub Text2_Change()

静态outno作为整数

outno = Text2.Text

结束子


Public Sub Command1_Click()


如果Option1.Value = True且Option4.Value = True然后

outno = inno

结束如果


如果Option2.Value = True且Option5.Value =真然后

outno = inno

结束如果


如果Option3.Value = True且Option6.Value = True则

outno = inno

结束如果


''如果Option1.Value = True且Option6.Value = True那么

''outno = inno

''结束如果

''Dim counter As Integer

''对于counter = 0到9

End Sub
It''s the same program; where i got to convert a number from one number system to another..... m a bit confused regarding scope of different variables.
Here is my program that i wrote in Microsoft Visual Basic 6.0; for now its having only 3 options and that too converting a number from one to same number system.. Not actually converting also.. but its not displaying anything in text2.
Here is the code.I dont know how will i copy the form of VB.

Public Sub Text1_Change()
Static inno As Integer
inno = Text1.Text
End Sub

Public Sub Text2_Change()
Static outno As Integer
outno = Text2.Text
End Sub

Public Sub Command1_Click()

If Option1.Value = True And Option4.Value = True Then
outno = inno
End If

If Option2.Value = True And Option5.Value = True Then
outno = inno
End If

If Option3.Value = True And Option6.Value = True Then
outno = inno
End If

''If Option1.Value = True And Option6.Value = True Then
''outno = inno
''End If
''Dim counter As Integer
''For counter = 0 To 9
End Sub


这篇关于我在VB的第一个程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆