Associate
- Joined
- 31 Dec 2002
- Posts
- 458
Hi, I am stuck for the last week trying to understand what is probably staight forward for most of you. In vb 2010 I am trying to do the following:
Have a customer class with the following properties so:
public class Customer
public property name as string
public property bill as string
public property usage as string
end class
I want a sub routine that creates a new instance of the Customer class after a customer has entered their name in a textbox,taking the name from a textbox as the parameter, something like:
private sub addCustomer(name as string)
dim name as new Customer
newCustomer.name = txtName.text
newCustomer.usage = txtUsage.text
newCustomer.bill = txtBill.text
end sub
I feel I may be close but would appreciate it if someone could give me a steer. I have omitted the form start and end class code and other code, but it is just the standard prepopulated code. I have also created the customer class by adding new class. thanks
Have a customer class with the following properties so:
public class Customer
public property name as string
public property bill as string
public property usage as string
end class
I want a sub routine that creates a new instance of the Customer class after a customer has entered their name in a textbox,taking the name from a textbox as the parameter, something like:
private sub addCustomer(name as string)
dim name as new Customer
newCustomer.name = txtName.text
newCustomer.usage = txtUsage.text
newCustomer.bill = txtBill.text
end sub
I feel I may be close but would appreciate it if someone could give me a steer. I have omitted the form start and end class code and other code, but it is just the standard prepopulated code. I have also created the customer class by adding new class. thanks