G
Guest
I have an html table based form that has textboxes embedded in table rows on
it. I wanted to have the textboxes autosize and also have the table rows
autosize. To accomplish this, I added a user-defined function that counts
the number of carriage return/line feeds and sets the textbox's Row property
accordingly. This works to autosize the textbox. Also, I wanted the
containing table row to autosize to show the full textbox. The reason for
this is I'm making the textbox appear as a label (style="OVERFLOW: hidden").
To accomplish, I have the function pass back a string with the number of
pixels represented by the number of rows in the textbox. I assign this
return value to the Height attribute of the row as follows:
<TD vAlign="middle" align="left" colSpan="4" style="HEIGHT:
=GetKeyTermsHeight()" >
This works great! The problem is that the next time I open the form, the
Visual Studio designer opens the form and goes to the Design tab. This
reformats the HTML automatically and removes the style="HEIGHT:
=GetKeyTermsHeight()" code above. No warning! I turned off ALL auto
formatting of HTML/XML in Tools/Options. No help there! What can be done to
prevent this? Currently, I'm saving the <TD> definition to the Code behind
window as a comment and repasting it in the HTML view before rebuilding my
solution. It's a big pain though because the project is very large, and I'm
concerned that another developer will unwillingly change and lose this
feature for me. I'd like to add the autosize to my other forms, but doing so
would be a code management nightmare that I can't afford right now. Any
ideas? Please!
it. I wanted to have the textboxes autosize and also have the table rows
autosize. To accomplish this, I added a user-defined function that counts
the number of carriage return/line feeds and sets the textbox's Row property
accordingly. This works to autosize the textbox. Also, I wanted the
containing table row to autosize to show the full textbox. The reason for
this is I'm making the textbox appear as a label (style="OVERFLOW: hidden").
To accomplish, I have the function pass back a string with the number of
pixels represented by the number of rows in the textbox. I assign this
return value to the Height attribute of the row as follows:
<TD vAlign="middle" align="left" colSpan="4" style="HEIGHT:
=GetKeyTermsHeight()" >
This works great! The problem is that the next time I open the form, the
Visual Studio designer opens the form and goes to the Design tab. This
reformats the HTML automatically and removes the style="HEIGHT:
=GetKeyTermsHeight()" code above. No warning! I turned off ALL auto
formatting of HTML/XML in Tools/Options. No help there! What can be done to
prevent this? Currently, I'm saving the <TD> definition to the Code behind
window as a comment and repasting it in the HTML view before rebuilding my
solution. It's a big pain though because the project is very large, and I'm
concerned that another developer will unwillingly change and lose this
feature for me. I'd like to add the autosize to my other forms, but doing so
would be a code management nightmare that I can't afford right now. Any
ideas? Please!