|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
label and decimal valueIs there any know problem with sending a decimal value to a label
control in .net 2.0? I am assigning the label value to a label control like this: Dim New MyObject as Object lblDecimal.Text = MyObject.DecimalValue The label is showing a 0 when it should be returning a decimal value. Any help is appreciated. Qiana In your MyObject class code, is DecimalValue explicitly set to some
value (other than zero) in the default constructor (ie, the constructor that you supply with no arguments), or has some non-zero default value set some other way? If not, then the Framework defaults this value to zero, and that would be why you are seeing the 0 in the label. If you want to see decimal places, then try lblDecimal.Text = MyObject.DecimalValue.ToString("#.000"); ============== Clay Burch Syncfusion, Inc. what id the values againt propert DecimalValue.
if u are no initializing the private member, then by default it is zero Show quote "Qiana" <QTi***@gmail.com> wrote in message news:1173301387.296427.15990@p10g2000cwp.googlegroups.com... > Is there any know problem with sending a decimal value to a label > control in .net 2.0? I am assigning the label value to a label control > like this: > > Dim New MyObject as Object > > lblDecimal.Text = MyObject.DecimalValue > > The label is showing a 0 when it should be returning a decimal value. > > Any help is appreciated. > > Qiana >
Show quote
On Mar 8, 4:21 am, "Mubashir Khan" <m***@yahoo.com> wrote: Thank you both for getting back to me. Unfortunately, someone had> what id the values againt propert DecimalValue. > if u are no initializing the private member, then by default it is zero"Qiana" <QTi***@gmail.com> wrote in message > > news:1173301387.296427.15990@p10g2000cwp.googlegroups.com... > > > > > Is there any know problem with sending a decimal value to a label > > control in .net 2.0? I am assigning the label value to a label control > > like this: > > > Dim New MyObject as Object > > > lblDecimal.Text = MyObject.DecimalValue > > > The label is showing a 0 when it should be returning a decimal value. > > > Any help is appreciated. > > > Qiana- Hide quoted text - > > - Show quoted text - commented out the line in the class that set the property. I knew something weird was going on. Thanks again for your help. I really appreciate it. Qiana |
|||||||||||||||||||||||