Click here to Skip to main content
15,884,472 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Generalsetting the crystal print preview as landscape Pin
en.Mahdi11-Apr-08 19:00
en.Mahdi11-Apr-08 19:00 
GeneralCOM port programming [modified] Pin
ASPnoob11-Apr-08 17:38
ASPnoob11-Apr-08 17:38 
GeneralRe: COM port programming Pin
Dave Kreskowiak11-Apr-08 18:23
mveDave Kreskowiak11-Apr-08 18:23 
GeneralRe: COM port programming Pin
ASPnoob11-Apr-08 19:18
ASPnoob11-Apr-08 19:18 
GeneralRe: COM port programming Pin
Dave Kreskowiak12-Apr-08 3:35
mveDave Kreskowiak12-Apr-08 3:35 
GeneralRe: COM port programming Pin
Marc Soleda12-Apr-08 6:04
Marc Soleda12-Apr-08 6:04 
GeneralRe: COM port programming Pin
ASPnoob12-Apr-08 7:45
ASPnoob12-Apr-08 7:45 
Generalsmall class problem Pin
jesseax11-Apr-08 17:37
jesseax11-Apr-08 17:37 
hey all, ok i have this really small program that needs one more thing to get it completed and i am extremly new to visual basic and i just can't figure this out.

Ok, so this is a program that when u debug it, you put in you first and last name and then click calculate, then an inputbox comes up asking: "What grade do you teach?" you can put any grade in, so i put "6" in (without the quotes) and then when i click ok another box comes up and is susposed to say, "John Smith teaches grade 6" but when i click the ok button it only displays "John smith teaches grade" and doesn't display the number 6, that's all i am tryign to display. Does any one no how to get that number 6, or any number really to be displayed? If you could check this out that'd be great! Here is the code, the interface is 2 text boxes, 1 asking for your first name and the other asking for your last name, and a button saying "calculate"

Public Class Form1

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Employee As New Person
Dim strgrade As Integer
Dim DOB As Date

Employee.FirstName = TextBox1.Text
Employee.LastName = TextBox2.Text

strgrade = InputBox("What Grade Do you Teach?", "Grade Ask")

MessageBox.Show(Employee.FirstName & " " & Employee.LastName _
& " teaches grade " & Employee.Age(DOB) & "")
End Sub
End Class
Public Class Person
Private Name1 As String
Private Name2 As String
Public Property FirstName() As String
Get
Return Name1

End Get

Set(ByVal value As String)
Name1 = value
End Set
End Property
Public Property LastName() As String
Get
Return Name2

End Get

Set(ByVal value As String)
Name2 = value
End Set
End Property

Public Function Age(ByVal Birthday As Date) As Integer

Return Int(Now.Subtract(Birthday).Days / 365.25)

End Function
End Class
Public Class Teacher
Inherits Person
End Class

/J-Man\

GeneralRe: small class problem Pin
Dave Kreskowiak11-Apr-08 18:20
mveDave Kreskowiak11-Apr-08 18:20 
GeneralRe: small class problem Pin
jesseax11-Apr-08 20:17
jesseax11-Apr-08 20:17 
GeneralRe: small class problem Pin
Dave Kreskowiak12-Apr-08 3:37
mveDave Kreskowiak12-Apr-08 3:37 
GeneralRe: small class problem Pin
jesseax12-Apr-08 6:28
jesseax12-Apr-08 6:28 
GeneralRe: small class problem Pin
Dave Kreskowiak12-Apr-08 12:18
mveDave Kreskowiak12-Apr-08 12:18 
GeneralRe: small class problem Pin
jesseax12-Apr-08 17:52
jesseax12-Apr-08 17:52 
GeneralRe: small class problem Pin
Dave Kreskowiak13-Apr-08 10:22
mveDave Kreskowiak13-Apr-08 10:22 
GeneralRe: small class problem Pin
jesseax13-Apr-08 16:34
jesseax13-Apr-08 16:34 
GeneralRe: small class problem Pin
Dave Kreskowiak14-Apr-08 2:48
mveDave Kreskowiak14-Apr-08 2:48 
GeneralRe: small class problem Pin
jesseax14-Apr-08 15:33
jesseax14-Apr-08 15:33 
GeneralRe: small class problem Pin
Dave Kreskowiak15-Apr-08 1:27
mveDave Kreskowiak15-Apr-08 1:27 
QuestionProblem of Pocket PC control robot Pin
GODPREAL11-Apr-08 10:44
GODPREAL11-Apr-08 10:44 
GeneralRe: Problem of Pocket PC control robot Pin
pmarfleet11-Apr-08 11:00
pmarfleet11-Apr-08 11:00 
GeneralRe: Problem of Pocket PC control robot Pin
Smithers-Jones12-Apr-08 4:36
Smithers-Jones12-Apr-08 4:36 
QuestionPrinting Code Pin
parth.p11-Apr-08 6:27
parth.p11-Apr-08 6:27 
GeneralRe: Printing Code Pin
Dave Kreskowiak11-Apr-08 7:21
mveDave Kreskowiak11-Apr-08 7:21 
GeneralRe: Printing Code Pin
parth.p11-Apr-08 8:11
parth.p11-Apr-08 8:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.