Value from UserControl rounded

  • Thread starter Thread starter RvGrah
  • Start date Start date
R

RvGrah

I have a usercontrol written in C# that exposes a public property of
type double. This control is used in a program written in VB.net.

If I set the value to 66.6667, it stays fine, I can break into the
usercontrol code at various events that can change the values and it's
still 66.6667.

However, if I iterate over the controls (they're in a FlowLayoutPanel)
in the vb code to get the values in question, they're rounded off to
one decimal place, in other words 66.6.

This happens whether I break into the vb code in the parent form and
see the value in question or in the C# user control's code at runtime
in the vb app.

This only happens if I iterate over the controls from the vb code. The
usercontrol exposes no ability to change the value directly by the
parent, only events contained in the usercontrol can change the value.

If I'm presenting the question badly ask what else I need to provide.

Thanks, Bob Graham
 
Never mind, found my error in the validating event when the
usercontrol loses focus, my test and validate routine was flawed.

Bob Graham
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top