.aspx file
Untitled Page
Izaberi boju:
Izaberi font:
Izaberi velicinu fonta:
Izaberi border style:
Upisi tekst cestitke ispod:
.aspx.cs file
// potrebno je uneti celobrojne vrednosti u polje za velicinu fonta
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
System.Drawing.Text.InstalledFontCollection fonts;
Font f;
if (!this.IsPostBack)
{
DropDownList1.Items.Add("White");
DropDownList1.Items.Add("Red");
DropDownList1.Items.Add("Green");
DropDownList1.Items.Add("Blue");
DropDownList1.Items.Add("Yellow");
fonts = new System.Drawing.Text.InstalledFontCollection();
foreach (FontFamily family in fonts.Families)
{
DropDownList2.Items.Add(family.Name);
}
//DropDownList2.Items.Add("Times New Roman");
//DropDownList2.Items.Add("Arial");
//DropDownList2.Items.Add("Verdana");
//DropDownList2.Items.Add("Tahoma");
//dodaje List Iteme za border style
ListItem item = new ListItem();
item.Text = BorderStyle.None.ToString();
item.Value = ((int)BorderStyle.None).ToString();
BordStl.Items.Add(item);
item = new ListItem();
item.Text = BorderStyle.Double.ToString();
item.Value = ((int)BorderStyle.Double).ToString();
BordStl.Items.Add(item);
item = new ListItem();
item.Text = BorderStyle.Solid.ToString();
item.Value = ((int)BorderStyle.Solid).ToString();
BordStl.Items.Add(item);
BordStl.SelectedIndex = 0;
Image1.ImageUrl = "slika.jpg";
}
}
protected void DropDownList2_SelectedIndexChanged(object sender,
EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
Panel1.BackColor=Color.FromName(DropDownList1.SelectedItem.Text);
Poruka.Font.Name = DropDownList2.SelectedItem.Text;
if (Int32.Parse(TextBox1.Text) > 0)
{
Poruka.Font.Size = FontUnit.Point(Int32.Parse(TextBox1.Text));
}
Panel1.BorderStyle =
(BorderStyle)Int32.Parse(BordStl.SelectedItem.Value);
if (CheckBox1.Checked)
{
Image1.Visible = true;
}
else
{
Image1.Visible = false;
}
Poruka.Text = TextBox2.Text;
}
}