| |||||||||||||||||||||||
ImageAlign EnumerationSystem.Web.UI.WebControls Namespace Specifies the alignment of an image in relation to adjacent text. Members
RemarksThe ImageAlign enumeration represents the alignment options for an image relative to adjoining text on a Web page. ExampleThe following example shows how to declaratively set the ImageAlign property of an Image control at design time. <asp:image id = "myImg" runat = "server" imageurl = "~/shared/images/earth.gif" imagealign = "right" /> The example below shows how to programmatically set the ImageAlign property at run time, depending on user input. The code also demonstrates how simple it is to retrieve the available system alignment styles and dynamically add each to a selectable list. void Page_Load ( Object src, EventArgs e ) {
if ( !IsPostBack ) {
ICollection alignEnum =
TypeDescriptor.GetConverter ( typeof ( ImageAlign ) ).GetStandardValues ( );
foreach ( ImageAlign a in alignEnum ) {
alignSelect.Items.Add ( a.ToString ( ) );
}
}
theImg.ImageAlign = ( ImageAlign ) alignSelect.SelectedIndex;
}
See Also |
| ||||||||||||||||||||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme