|
-
Apr 25th, 2010, 12:50 AM
#1
Thread Starter
Member
Error in the code
Hey guys, while I was coding for my application. I ran into a problem
Here's my code
Code:
outputTextBox = outputTextBox &
(counter + 1).ToString().PadLeft(2) & TotalSales(counter).ToString("C2").PadLeft(16) & bonus(counter).ToString("C2").PadLeft(17)
& ControlChars.NewLine
It says " Operator '&' is not defined for types 'System.Windows.Forms.TextBox' and 'String"
Any help is appreciated! =)
-
Apr 25th, 2010, 01:00 AM
#2
Re: Error in the code
Think about what you actually want to do. Do you really want to join a String to a TextBox, or do you actually want to join a String to the contents of the TextBox? If it's the latter, how do you access the contents of a TextBox? Also, what do you really want to do with the result? Do you really want to replace the existing TextBox, or do you actually want to replace the contents of the TextBox?
-
Apr 25th, 2010, 01:16 AM
#3
Thread Starter
Member
Re: Error in the code
Thanks I actually figured it out.
Code:
outputTextBox.Text = outputTextBox.Text & Bonustable(row, 0).ToString.PadRight(3) & Bonustable(row, 1).ToString("c0").PadLeft(12) & Bonustable(row, 2).ToString("c0").PadLeft(12) & ControlChars.NewLine
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
|