473,396 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Formatting textboxes in VB.NET

It looks like the Format method is another one that didn't make it to the
..NET controls. Since I need to force a decimal placeholder to values going
into the textboxes, I tried the following code:

Temp1D_textbox.Text = Format("{0:F1}", dcon_x4.AnalogIn)

If I understand correctly, this should force one number to the right of the
decimal, even if it's zero, which is what I want. However, zeroes don't show
up; the numbers are truncated as if the formatting wasn't there.

I've also tried other format strings, such as:

Temp1D_textbox.Text = Format("{0:###.0}", dcon_x4.AnalogIn)

....but nothing makes any difference.

Any ideas on how to accomplish this? Searches have turned up nothing so far.

Thanks,

Randall Arnold
Nov 21 '05 #1
1 2069
Oops, nevermind, I just figured it out. My code needs to include the String
method (prior to Format), as shown below:

Temp1D_textbox.Text = String.Format("{0:F1}", dcon_x4.AnalogIn)

Sorry!

Randall Arnold

"Randall Arnold" wrote:
It looks like the Format method is another one that didn't make it to the
.NET controls. Since I need to force a decimal placeholder to values going
into the textboxes, I tried the following code:

Temp1D_textbox.Text = Format("{0:F1}", dcon_x4.AnalogIn)

If I understand correctly, this should force one number to the right of the
decimal, even if it's zero, which is what I want. However, zeroes don't show
up; the numbers are truncated as if the formatting wasn't there.

I've also tried other format strings, such as:

Temp1D_textbox.Text = Format("{0:###.0}", dcon_x4.AnalogIn)

...but nothing makes any difference.

Any ideas on how to accomplish this? Searches have turned up nothing so far.

Thanks,

Randall Arnold

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: msmcg | last post by:
I need to format the data in some textboxes using the Binding method with custom Currency and ShortDate format and parse handlers. Here is the code that I am using. I call it on the form load...
8
by: G.Ashok | last post by:
Hi, I have created CultureInfo object and specified required digit grouping in it. The one of the overloaded ToString methods of Decimal type has parameters to format the value with required...
4
by: Michael Turner | last post by:
Hi Guys I need to format multiple textboxes that are bound to a dataset, this dataset can have its datachanged and refresh the data in the text boxes at any time so I need a method that is...
2
by: Mitchell Vincent | last post by:
I have a bunch of text boxes and labels that hold currency values. I need some formatting on them, but since they are databound to a set, I'm confused as to how to do that. Do labels and text boxes...
2
by: jodyblau | last post by:
I'm not certain that what I am trying to do is possible; in any event I haven't been able to figure it out. Here is what I am trying to do: I have one table that has a list of cases I'm working...
4
by: Peter Newman | last post by:
the data input app im writing has some 30 + input fields and i want to be able to format them. I know i can use the .validate on each textbox and format the 'string' however this require loads...
2
by: Peter Newman | last post by:
Firstly i would like to tank the helpful posts in the past regarding formatting... the scenario is that i ahve a form created by the data wizard. I have created a private sub to handle the...
10
by: Lyn | last post by:
Hi, I would like to make a bound text box not visible if it is empty (not just disable it). This option is not available from the standard conditional formatting feature (at least, not that I can...
2
by: robertng90025 | last post by:
I'm having a problem with MS Access 2003 and its conditional formatting. I have textboxes on a continuous form whose left and right margins are set to 0.03 inches. Based on each textbox's...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.