|
-
Oct 4th, 2006, 08:29 PM
#1
Thread Starter
Fanatic Member
error when binding a maskedEd control to a property of a custom business class
I delcare my entity class:
public class address
{
private string postalCode="";
private string streetName="";
public string StreetName
{
get { return streetName;}
set { streetName=value;}
}
public string PostalCode
{
get { return postalCode;}
set { postalCode=value;}
}....etc
Then in my address form frmAddress I do: (TxtStrNam and TxtPostalCode re my 2 textboxes in the form. i know that s obvious) i do like this:
Public Class frmAddress
{
Dim oAddress As New address;
this.TxtStrNam.DataBindings.Add("Text", oAddress, "StreetName");
this.TxtPostalCode.DataBindings.Add("FormattedText", oAddress, "PostalCode");
.......etc
But I get an error: object reference not set to an nstance of an object in the line:
this.TxtPostalCode.DataBindings.Add("FormattedText", oAddress, "PostalCode");
That means my assignment to private variable: private string postalCode=""; is not working
2/ do u guys use maskedEd control to control user input or is there another method or better practice instead of using VB6 msmask.dll
Thanks a lot
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|