Posts

Showing posts with the label vb

Write a program using while statement to print even-odd number between 1-50

Image
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click While A < 50 If (A Mod 2 = 0) Then ListBox1.Items.Add(A) A = A + 1 Else ListBox2.Items.Add(A) A = A + 1 End If End While End Sub End Class

Write a program using inputbox(),msgbox() and perform various arithmetic expression

Image
Write a program using inputbox(),msgbox() and perform various arithmetic expression is very important question in vb .net so let's get started: public class form1 Dim i, j, h as integer i = input value box ("Enter the first value"); j = input box ("Enter the second value"); h = val(i) + val(j) msgbox("Addition =" Rh) End sub

Write a program to implement the namespace Student in your VB net Application

Image
Write a program to implement the namespace Student in your VB net Application is very important question in vb .net so let's get started: Namespace student public class roll_no sub roll_no() console.writeline("my roll number is ") end sub end class end namespace module modules submain() Dim as new student_roll_no End sub End module

Write a program using user defined and existing namespace in vb.net

Image
Write a program using user defined and existing namespace in vb.net steps to program using user defined and existing namespace in vb.net Note here I am using visual express 2012. 1)Create your console application Ok now as you see in the image click on the "file" button at left-corner after clicking click on the "New project" after clicking on new project click on "console application" and give the name you like and click on ok,here I am giving Helloworld for my program. As, you have clicked on ok you will be seee such interface 2)Creating a class in vb.net Steps to create class Right click on the solution explorer cick on the "Add" element as shown in image And now click on on "new item" And now click on on "Class" Here I am taking default class name which is class1.vb. As a begineer you should take this as default or you can take diffrent name as the class name 3) Adding code in vb.net yo! your screen i...

VB.NET important questions | syntax

Image
What is namespace? Namespaces organize the objects defined in an assembly. Assemblies can contain multiple namespaces, which can in turn contain other namespaces. Namespaces prevent ambiguity and simplify references when using large groups of objects such as class libraries Syntax for vb.net 1) If-else control system If condition [ Then ] [ statements ] [ ElseIf condition [ Then ] [ statements ] ] [ Else [ elsestatements ] ] End If 2) Select case statement: Select [Case] expression [ Case expression list [ statements ] ] [ Case Else [ else statements ] ] End Select Do loop Do [ statements ] [ Continue Do ] [ statements ] [ Exit Do ] [ statements ] Loop { While | Until } condition while loop While condition Statements Exit While Statements End While for each loop For Each [ Item ] In [ Group ] [ loopBody ] Next [ Item ] 'Item: The Item in the group 'Group: The group containing similar items 'LoopBody: The code you want to execute withi...