TextBox.Width - driving me nuts !

G

Guest

Hi there

Someone please put me out of my misery...

I am attempting to offer a graphical view of some data in an aspx page by
using the width property of some colored text boxes. The data is derived from
an On Line Poll - there are a possible 10 answers to each poll - so I have
created an HTML table with 3 columns and 10 rows. Column 1 has a Label that
shows the poll answer, column 2 has a textbox with no text in that is
supposed to represent the % of votes for that answer and column 3 has the %
value again contained in a label.

Whatever I do - the textbox.width is completely and utterly ignored for some
reason. The following is some self explanatory hard code that should
highlight my plight...

If pollAnswer1 = "-" Then
lblAnswer1Answer.Text = ""
lblAnswer1Answer.Visible = False
lblAnswer1Bar.Visible = False
lblAnswer1Pcent.Visible = False
Else
lblAnswer1Answer.Text = pollAnswer1
lblAnswer1Answer.Visible = True
Dim a1 As Integer = ((pollAnswer1Count / pollTotalVoted * 100) *
4)
lblAnswer1Bar.Width.Pixel(a1)
lblAnswer1Pcent.Visible = True
lblAnswer1Pcent.Text = Format(pollAnswer1Count / pollTotalVoted
* 100, "N1") & "%"
lblAnswer1Bar.Visible = True
End If

So - if the poll answer is '-' then this answer was not used in the poll so
hide everything - otherwise this answer was used and retrieve the data from
memory etc etc - so I am taking the % value for that answer and multiplying
it by 4 so that the width is meaningful - it will (one day) show as a
horizontal bar chart - all very simple.... but what am I missing here ??? -
the text box that represents the bar of the bar graph stays the same width.

This all occurs in the Page_Load routine - all the variables are present and
available and of the correct data type from what I can see.

Any ideas would be much appreciated
(I have tried simply hard coding the width rather than using the calculation
on my variables... it still ignores me !)

Thanks

Stuart
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,069
Latest member
SimplyleanKetoReviews

Latest Threads

Top