public override void RenderControl(System.Web.UI.HtmlTextWriter writer) { this.Font.Name = "Tahoma"; this.Font.Size = FontUnit.Point(8); this.RowStyle.Height = Unit.Pixel(20); this.RowStyle.VerticalAlign = VerticalAlign.Top; try { this.HeaderRow.BorderWidth = Unit.Pixel(1); this.HeaderRow.BackColor = System.Drawing.Color.Black; this.HeaderRow.ForeColor = System.Drawing.Color.White; this.HeaderRow.Height = Unit.Pixel(30); this.HeaderRow.BorderColor = System.Drawing.Color.White; this.HeaderRow.BorderStyle = BorderStyle.Solid; } catch (Exception ex) { } for (int i = 0; i < this.Rows.Count; i++) { if (i % 2 == 0) { this.Rows[i].BackColor = System.Drawing.Color.WhiteSmoke; } } base.RenderControl(writer); }
protected void Page_Load(object sender, EventArgs e) { PopupWin1.Visible = false; if (!Page.IsPostBack) { String sql1 = "select * from [qingjia] where q_statue='1' ORDER BY q_enddate DESC"; DataTable dt_allgongzuori = SqlHelper.ExecuteDataTable(sql1); int i_all = dt_allgongzuori.Rows.Count; if (i_all > 0) { PopupWin1.Visible = true; this.PopupWin1.Message = "你有员工申请申报消息需要处理"; this.PopupWin1.Font.Size = FontUnit.Point(42); } else { PopupWin1.Visible = false; } Calendar1.Visible = false; Calendar2.Visible = false; seeknowkaoqin(); startime.Text = DateTime.Now.AddDays(-6).ToString("yyyy-MM-dd"); endtime.Text = DateTime.Now.ToString("yyyy-MM-dd"); } }
/// <summary> /// Raises the <see cref="E:System.Web.UI.Control.Init"/> event. /// </summary> /// <param name="e">An <see cref="T:System.EventArgs"/> that contains the event data.</param> protected override void OnInit(EventArgs e) { base.OnInit(e); if (DesignMode) { return; } NodeIndent = 15; EnableClientScript = true; ShowLines = true; NodeStyle.Font.Size = FontUnit.Point(8); NodeStyle.ForeColor = Color.Black; NodeStyle.HorizontalPadding = Unit.Pixel(2); NodeStyle.NodeSpacing = Unit.Pixel(0); NodeStyle.VerticalPadding = Unit.Pixel(2); HoverNodeStyle.Font.Underline = true; HoverNodeStyle.ForeColor = ConverterColor.ToColor("#6666AA"); Nodes.Add(CreateNode("Root", 0, true)); }
protected void cmdUpdate_Click(object sender, EventArgs e) { pnlCard.BackColor = Color.FromName(lstBackColor.SelectedItem.Text); lblGreeting.Font.Name = lstFontName.SelectedItem.Text; if (Int32.Parse(txtFontSize.Text) > 0) { lblGreeting.Font.Size = FontUnit.Point(Int32.Parse(txtFontSize.Text)); } int borderValue = Int32.Parse(lstBorder.SelectedItem.Value); pnlCard.BorderStyle = (BorderStyle)borderValue; if (chkPicture.Checked) { imgDefault.Visible = true; } else { imgDefault.Visible = false; } lblGreeting.Text = txtGreeting.Text; }
public void inserisciCampoSeparatore(DocsPAWA.DocsPaWR.OggettoCustom oggettoCustom) { if (oggettoCustom.DESCRIZIONE.Equals("")) { return; } Label etichettaCampoSeparatore = new Label(); etichettaCampoSeparatore.Text = oggettoCustom.DESCRIZIONE; etichettaCampoSeparatore.Font.Size = FontUnit.Point(8); etichettaCampoSeparatore.Font.Bold = true; etichettaCampoSeparatore.Font.Name = "Verdana"; System.Web.UI.HtmlControls.HtmlGenericControl rigaSeparatore = new HtmlGenericControl("hr"); rigaSeparatore.Style.Value = "width=100%;"; TableRow row_1 = new TableRow(); TableCell cell_1 = new TableCell(); cell_1.Controls.Add(etichettaCampoSeparatore); cell_1.Controls.Add(rigaSeparatore); cell_1.ColumnSpan = 2; row_1.Cells.Add(cell_1); table.Rows.Add(row_1); }
//This is page load event of Welcome Page, this event will be triggered when user redirected to this page protected void Page_Load(object sender, EventArgs e) { // If the session value is not null if (Session["userLoggedin"] != null) { lblMessage.ForeColor = System.Drawing.Color.Green; lblMessage.Font.Size = FontUnit.Point(15); lblMessage.Text = "Welcome, session is Alive and the value of Session is: " + Session["userLoggedin"].ToString(); //Fetching the value of Cookie 'ASP.NET_SessionI' for the demo purpose string cookieValue = ""; if (Request.Cookies.Count > 0) { cookieValue = Request.Cookies["ASP.NET_SessionId"].Value; lblMessage.Text = "You session value is " + cookieValue; } btnLogout.Visible = true; } else { string cookieValue = ""; if (Request.Cookies.Count > 0) { cookieValue = Request.Cookies["ASP.NET_SessionId"].Value; lblMessage.ForeColor = System.Drawing.Color.Red; lblMessage.Font.Size = FontUnit.Point(15); lblMessage.Text = "You session value is " + cookieValue; } } }
protected void Button1_Click(object sender, EventArgs e) { Panel1.BackColor = Color.FromName(DropDownList1.SelectedItem.Text); if (Int32.Parse(DropDownList3.SelectedItem.Text) > 0) { Label1.Font.Size = FontUnit.Point(Int32.Parse(DropDownList3.SelectedItem.Text)); } //Label1.ForeColor = Color.FromName(DropDownList4.SelectedItem.Text); Image1.ImageUrl = "1.png"; Label1.Font.Name = DropDownList2.SelectedItem.Text; if (CheckBox1.Checked) { Image1.Visible = true; } else { Image1.Visible = false; } Label1.Text = TextBox1.Text; }
private void UpdateCard() { RightPanel.Visible = true; // Update the panel. RightPanel.BackColor = Color.FromName(DDLBackColors.SelectedItem.Text); RightPanel.ForeColor = Color.FromName(DDLFontColors.SelectedItem.Text); // Update the image. imgCard.ImageUrl = "~/Images/" + DDLCardImage.SelectedValue; // Update the text. labelCardHeading.Text = txtCardHeading.Text; labelCardHeading.Font.Name = DDLFontFamily.SelectedItem.Text; labelCardHeading.Font.Size = FontUnit.Point(Int32.Parse(DDLFontSize.SelectedItem.Value)); labelCardHeading.ForeColor = Color.FromName(DDLFontColors.SelectedItem.Text); labelCardMessage.Text = txtCardMessage.Text; labelCardMessage.Font.Name = DDLFontFamily.SelectedItem.Text; labelCardMessage.Font.Size = FontUnit.Point(Int32.Parse(DDLFontSize.SelectedItem.Value)); labelCardMessage.ForeColor = Color.FromName(DDLFontColors.SelectedItem.Text); Double price = Convert.ToDouble(RadioButtonList1.SelectedValue); int numCards = Convert.ToInt32(txtNumberCards.Text); Double amountDue = price * numCards; lblMessage.Text = "Your total order due is $" + String.Format("{0, 7:c2}", amountDue.ToString()); }
protected void btnRand_Click(object sender, EventArgs e) { //建立並初始化亂數產生器 Random rnd = new Random(); //以亂數產生12~36的字型大小 int size = rnd.Next(12, 36); txtTitle.Font.Size = FontUnit.Point(size); //以亂數產生0~255前景色數值 int r = rnd.Next(0, 255); //Red紅色 int g = rnd.Next(0, 255); //Green綠色 int b = rnd.Next(0, 255); //Blue藍色 //以亂數設定標題前景色(Red , Green , Blue) txtTitle.ForeColor = Color.FromArgb(r, g, b); //以亂數產生0~255背景色數值 int r1 = rnd.Next(0, 255); //Red紅色 int g1 = rnd.Next(0, 255); //Green綠色 int b1 = rnd.Next(0, 255); //Blue藍色 //以亂數設定標題背景色(Red , Green , Blue) txtTitle.BackColor = Color.FromArgb(r1, g1, b1); txtMsg.Text = "字型大小為:" + size + "<BR/>"; txtMsg.Text += String.Format("前景色:Red:{0} , Green:{1} , Blue:{2}", r, g, b); txtMsg.Text += "<BR/>" + String.Format("背景色:Red:{0} , Green:{1} , Blue:{2}", r1, g1, b1); }
public override void Apply(Calendar wc) { CalendarAutoFormatDialog.WCScheme.ClearCalendar(wc); wc.DayNameFormat = DayNameFormat.FirstLetter; wc.NextPrevFormat = NextPrevFormat.CustomText; wc.TitleFormat = TitleFormat.MonthYear; wc.CellPadding = 4; wc.CellSpacing = 0; wc.ShowGridLines = false; wc.Height = Unit.Pixel(180); wc.Width = Unit.Pixel(200); wc.BorderColor = Color.FromArgb(0x99, 0x99, 0x99); wc.ForeColor = Color.Black; wc.BackColor = Color.White; wc.Font.Name = "Verdana"; wc.Font.Size = FontUnit.Point(8); wc.TitleStyle.Font.Bold = true; wc.TitleStyle.BorderColor = Color.Black; wc.TitleStyle.BackColor = Color.FromArgb(0x99, 0x99, 0x99); wc.NextPrevStyle.VerticalAlign = VerticalAlign.Bottom; wc.DayHeaderStyle.Font.Bold = true; wc.DayHeaderStyle.Font.Size = FontUnit.Point(7); wc.DayHeaderStyle.BackColor = Color.FromArgb(0xcc, 0xcc, 0xcc); wc.SelectorStyle.BackColor = Color.FromArgb(0xcc, 0xcc, 0xcc); wc.TodayDayStyle.BackColor = Color.FromArgb(0xcc, 0xcc, 0xcc); wc.TodayDayStyle.ForeColor = Color.Black; wc.SelectedDayStyle.BackColor = Color.FromArgb(0x66, 0x66, 0x66); wc.SelectedDayStyle.ForeColor = Color.White; wc.SelectedDayStyle.Font.Bold = true; wc.OtherMonthDayStyle.ForeColor = Color.FromArgb(0x80, 0x80, 0x80); wc.WeekendDayStyle.BackColor = Color.FromArgb(0xff, 0xff, 0xcc); }
public void wbtn2_Click(object sender, EventArgs e) { pnlMappen.Controls.Clear(); Button button = sender as Button; // Page.ClientScript.RegisterStartupScript(this.GetType(), "Scripts", "<script>alert('" + button.ID + " - " + button.ID.Substring(2) + "');</script>"); c = new Categorie(); Session["categorie"] = (String)button.ID.Substring(2); c.getSUBCategorie(); foreach (Categorie cat in c.categorieen) { Button ButtonChange = new Button(); ButtonChange.Height = 100; ButtonChange.Width = 120; ButtonChange.Text = cat.Naam; ButtonChange.ID = "id" + cat.BijdrageID.ToString(); ButtonChange.Font.Size = FontUnit.Point(7); ButtonChange.ControlStyle.CssClass = "button"; ButtonChange.Click += new EventHandler(wbtn_Click); // ButtonChange.OnClientClick = "return false"; // ButtonChange.CausesValidation = false; pnlMappen.Controls.Add(ButtonChange); } }
public void cmdUpdate_Click(object sender, EventArgs args) { // Update the color pnlCard.BackColor = System.Drawing.Color.FromName(lstBackColor.SelectedItem.Text); // update font lblGreeting.Font.Name = lstFontName.SelectedItem.Text; if (Int32.Parse(txtFontSize.Text) > 0) { lblGreeting.Font.Size = FontUnit.Point(Int32.Parse(txtFontSize.Text)); } // update the border style requires two conversion steps // first, the value of the list item is converted from a string // to an integer. Next, the integer is converted into a value in // the BorderStyle enumeration int borderValue = Int32.Parse(lstBorder.SelectedItem.Value); pnlCard.BorderStyle = (BorderStyle)borderValue; // update the picture if (chkPicture.Checked) { imgDefault.Visible = true; } else { imgDefault.Visible = false; } // set the text lblGreeting.Text = txtGreeting.Text; }
protected void CreateRangeTextBoxes() { int j = DataTypeIndex.GetValueOrDefault(); ++j; TableCell cell2 = new TableCell(); cell2.ID = "Range"; TextBox tb1 = new TextBox(); TextBox tb2 = new TextBox(); Label lbl1 = new Label(); Label lbl2 = new Label(); // Set a unique ID for each TextBox added tb1.ID = "lowerbound_" + j.ToString(); tb2.ID = "upperbound_" + j.ToString(); lbl1.Text = "LowerBound:"; lbl1.Font.Size = FontUnit.Point(10); lbl1.Font.Bold = true; lbl1.Font.Name = "Arial"; lbl2.Text = "UpperBound:"; lbl2.Font.Size = FontUnit.Point(10); lbl2.Font.Bold = true; lbl2.Font.Name = "Arial"; cell2.Controls.Add(lbl1); cell2.Controls.Add(tb1); cell2.Controls.Add(lbl2); cell2.Controls.Add(tb2); TableRow rowtwo = dynamic_filter_table.FindControl("TableRow_") as TableRow; rowtwo.Cells.Add(cell2); dynamic_filter_table.Rows.Add(rowtwo); dynamic_filter_table.EnableViewState = true; ViewState["dynamic_filter_table"] = true; }
public override void Apply(Calendar wc) { CalendarAutoFormatDialog.WCScheme.ClearCalendar(wc); wc.DayNameFormat = DayNameFormat.Short; wc.NextPrevFormat = NextPrevFormat.FullMonth; wc.TitleFormat = TitleFormat.MonthYear; wc.CellPadding = 2; wc.CellSpacing = 0; wc.ShowGridLines = false; wc.Height = Unit.Pixel(190); wc.Width = Unit.Pixel(350); wc.BorderColor = Color.White; wc.BorderWidth = Unit.Pixel(1); wc.ForeColor = Color.Black; wc.BackColor = Color.White; wc.Font.Name = "Verdana"; wc.Font.Size = FontUnit.Point(9); wc.TitleStyle.Font.Bold = true; wc.TitleStyle.BorderColor = Color.Black; wc.TitleStyle.BorderWidth = Unit.Pixel(4); wc.TitleStyle.ForeColor = Color.FromArgb(0x33, 0x33, 0x99); wc.TitleStyle.BackColor = Color.White; wc.TitleStyle.Font.Size = FontUnit.Point(12); wc.NextPrevStyle.Font.Bold = true; wc.NextPrevStyle.Font.Size = FontUnit.Point(8); wc.NextPrevStyle.VerticalAlign = VerticalAlign.Bottom; wc.NextPrevStyle.ForeColor = Color.FromArgb(0x33, 0x33, 0x33); wc.DayHeaderStyle.Font.Bold = true; wc.DayHeaderStyle.Font.Size = FontUnit.Point(8); wc.TodayDayStyle.BackColor = Color.FromArgb(0xcc, 0xcc, 0xcc); wc.SelectedDayStyle.BackColor = Color.FromArgb(0x33, 0x33, 0x99); wc.SelectedDayStyle.ForeColor = Color.White; wc.OtherMonthDayStyle.ForeColor = Color.FromArgb(0x99, 0x99, 0x99); }
public BoundField buildBoundField(string header, string dataField, int width, bool wrap, string dataFormat) { BoundField bf = new BoundField(); bf.DataField = dataField; bf.HeaderText = header; //bf.HeaderStyle.Font.Name = "Tahoma"; bf.HeaderStyle.CssClass = "SP_dataLabel_Header"; bf.HeaderStyle.Wrap = false; bf.HeaderStyle.HorizontalAlign = HorizontalAlign.Left; bf.ItemStyle.Font.Size = FontUnit.Point(8); bf.ItemStyle.CssClass = "SP_dataLabel"; if (width > 0) { bf.ItemStyle.Width = Unit.Percentage(width); } bf.ItemStyle.Wrap = wrap; if (dataFormat.Length > 0) { bf.DataFormatString = dataFormat; } return(bf); }
public GridView DoGrid(DataTable sourceTable, string sType) { DataTable dataSource = sourceTable.Copy(); DataView dv = dataSource.DefaultView; dv.RowFilter = " type= '" + sType + "'"; DataTable dt = dv.ToTable(false, "SHIFT_DATE", "SHOP", "type", "DAILY_ACTUAL_QTY", "DAILY_PLAN_QTY", "MTD_ACTUAL_QTY", "MTD_PLAN_QTY"); GridView grid = new GridView(); grid.BorderStyle = BorderStyle.Solid; grid.BorderWidth = 1; grid.CellSpacing = 1; grid.BackColor = System.Drawing.Color.LightBlue; grid.GridLines = GridLines.None; grid.BorderColor = System.Drawing.Color.Silver; grid.HeaderStyle.BackColor = System.Drawing.Color.FromArgb(208, 215, 229); grid.HeaderStyle.ForeColor = System.Drawing.Color.Black; grid.RowStyle.BackColor = System.Drawing.Color.White; grid.RowStyle.ForeColor = System.Drawing.Color.Black; grid.RowStyle.Font.Size = FontUnit.Point(8); grid.Width = 750; grid.AllowPaging = true; grid.PageSize = 16; form1.Controls.Add(grid); //定義RowCreated,目的是為了隱藏欄位 grid.RowCreated += new GridViewRowEventHandler(GridView_RowCreated); grid.RowDataBound += new GridViewRowEventHandler(GridView_RowDataBound); grid.DataSource = dt; grid.DataBind(); //定義PageIndexChanging,目的是為了換頁 grid.PageIndexChanging += new GridViewPageEventHandler(GridView_PageIndexChanging); return(grid); }
protected void Button5_Click(object sender, EventArgs e) { // Update the color. pnlCard.BackColor = Color.FromName(lstBackColor.SelectedItem.Text); // Update the font. lblGreeting.Font.Name = lstFontName.SelectedItem.Text; if (Int32.Parse(txtFontSize.Text) > 0) { lblGreeting.Font.Size = FontUnit.Point(Int32.Parse(txtFontSize.Text)); } // Find the appropriate TypeConverter for the BorderStyle enumeration. TypeConverter converter = TypeDescriptor.GetConverter(typeof(BorderStyle)); // Update the border style using the value from the converter. pnlCard.BorderStyle = (BorderStyle)converter.ConvertFromString(lstBorder.SelectedItem.Text); // int borderValue = Int32.Parse(lstBorder.SelectedItem.Value); // pnlCard.BorderStyle = (BorderStyle)borderValue; // Update the picture. if (chkPicture.Checked) { imgDefault.Visible = true; } else { imgDefault.Visible = false; } // Set the text. lblGreeting.Text = txtGreeting.Text; // Refresh the greeting card (because a control was changed). MultiView1.Visible = false; UpdateCard(); }
//This is page load event of Logout Page, this event will be triggered when user redirected to this page protected void Page_Load(object sender, EventArgs e) { //Check all three variables Session1, Session2, Cookie. If all the three are not null then proceed further if (Session["userLoggedin"] != null && Session["AuthToken"] != null && Request.Cookies["AuthToken"] != null) { //Second Check, if Cookie we created has the same value as Second Session we've created if ((Session["AuthToken"].ToString().Equals( Request.Cookies["AuthToken"].Value))) { lblMessage.ForeColor = System.Drawing.Color.Green; lblMessage.Font.Size = FontUnit.Point(15); lblMessage.Text = "Welcome " + Session["userLoggedin"].ToString(); btnLogout.Visible = true; string cookieValue = ""; cookieValue = Request.Cookies["AuthToken"].Value; lblAuthCookie.ForeColor = System.Drawing.Color.Green; lblAuthCookie.Font.Size = FontUnit.Point(15); lblAuthCookie.Text = "You AuthToken is " + cookieValue; } else { Response.Redirect("~/SecureLoginFunc/SecureLogin.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { // Update the color. pnlCard.BackColor = Color.FromName(Session["color"].ToString()); // Update the font. lblGreeting.Font.Name = Session["fname"].ToString(); if (Int32.Parse(Session["fsize"].ToString()) > 0) { lblGreeting.Font.Size = FontUnit.Point(Int32.Parse(Session["fsize"].ToString())); } // Find the appropriate TypeConverter for the BorderStyle enumeration. TypeConverter converter = TypeDescriptor.GetConverter(typeof(BorderStyle)); // Update the border style using the value from the converter. pnlCard.BorderStyle = (BorderStyle)converter.ConvertFromString(Session["border"].ToString()); // int borderValue = Int32.Parse(lstBorder.SelectedItem.Value); // pnlCard.BorderStyle = (BorderStyle)borderValue; // Update the picture. imgDefault.ImageUrl = "imgDefault.jpeg"; if (Session["pic"].ToString() == "True") { imgDefault.Visible = true; } else { imgDefault.Visible = false; } // Set the text. lblGreeting.Text = Session["text"].ToString(); UpdateCard(); }
protected void cmdUpdate_Click(object sender, EventArgs e) { // Update the color. pnlCard.BackColor = Color.FromName(lstBackColor.SelectedItem.Text); // Update the font. lblGreeting.Font.Name = lstFontName.SelectedItem.Text; if (Int32.Parse(txtFontSize.Text) > 0) { lblGreeting.Font.Size = FontUnit.Point(Int32.Parse(txtFontSize.Text)); } // Update the border style. This requires two conversion steps. // First, the value of the list item is converted from a string // into an integer. Next, the integer is converted to a value in // the BorderStyle enumeration. // Find the appropriate TypeConverter for the BorderStyle enumeration. TypeConverter converter = TypeDescriptor.GetConverter(typeof(BorderStyle)); // Update the border style using the value from the converter. pnlCard.BorderStyle = (BorderStyle)converter.ConvertFromString( lstBorder.SelectedItem.Text); // Update the picture. if (chkPicture.Checked) { imgDefault.Visible = true; } else { imgDefault.Visible = false; } // Set the text. lblGreeting.Text = txtGreeting.Text; }
protected void Button1_Click(object sender, EventArgs e) { Button1.Text = "STOP"; Button1.Font.Size = FontUnit.Point(38); Button2.Text = "就叫你別按吧!!!!"; Button1.BackColor = System.Drawing.Color.Yellow; }
protected void ultraLegend_InitializeRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e) { intRowNum += 1; if (intRowNum == 1) { e.Row.Cells.FromKey("VIEW_NAME").Value = "조직점수"; e.Row.Style.Font.Bold = true; e.Row.Cells.FromKey("VIEW_NAME").Style.ForeColor = System.Drawing.Color.Chocolate; e.Row.Cells.FromKey("SCORE").Style.ForeColor = System.Drawing.Color.Chocolate; e.Row.Cells.FromKey("WEIGHT").Style.ForeColor = System.Drawing.Color.Chocolate; e.Row.Cells.FromKey("VIEW_NAME").Style.Font.Size = FontUnit.Point(11); e.Row.Cells.FromKey("SCORE").Style.Font.Size = FontUnit.Point(11); e.Row.Cells.FromKey("WEIGHT").Style.Font.Size = FontUnit.Point(11); e.Row.Height = Unit.Pixel(20); //e.Row.Style.BackColor = Color.Aqua; } else { e.Row.Cells.FromKey("VIEW_NAME").Style.ForeColor = System.Drawing.Color.Navy; e.Row.Cells.FromKey("SCORE").Style.ForeColor = System.Drawing.Color.Navy; e.Row.Cells.FromKey("WEIGHT").Style.ForeColor = System.Drawing.Color.Navy; e.Row.Style.Font.Bold = false; e.Row.Cells.FromKey("VIEW_NAME").Value = "" + e.Row.Cells.FromKey("VIEW_NAME").Value; } e.Row.Cells.FromKey("DASH").Value = "/"; }
//private void Cancel() //{ // ClientScriptManager csm = Page.ClientScript; // string tmp1 = "fnClose(); "; // csm.RegisterStartupScript(GetType(), "startup1", tmp1, true); //} private void Connect() { phControls.Controls.Clear(); DataTable dt; if (Request["templateID"] != null) { dt = wf.workflow2.GetTemplate(Request["templateID"]); } else { dt = wf.workflow2.GetTemplateList(wf._BP); } foreach (DataRow dr2 in dt.Rows) { Label lbl = new Label(); lbl.Font.Bold = true; lbl.Font.Name = "Tahoma"; lbl.Font.Size = FontUnit.Point(11); lbl.Text = dr2["Description"].ToString(); phControls.Controls.Add(lbl); Table tb1 = wf.drawSteps((int)dr2["ID"], true, _tableWidth, false); phControls.Controls.Add(tb1); HtmlGenericControl gc1 = new HtmlGenericControl(); gc1.InnerHtml = "<br />"; phControls.Controls.Add(gc1); } }
public BoundField buildBoundField(SelectedColumns.Column col, int width) { BoundField bf = new BoundField(); bf.DataField = col.dbFieldName; bf.HeaderText = col.HeaderText; bf.HeaderStyle.CssClass = "SP_dataLabel_Header"; bf.HeaderStyle.Wrap = false; bf.HeaderStyle.HorizontalAlign = col.horizontalAlign; bf.ItemStyle.Font.Size = FontUnit.Point(8); bf.ItemStyle.CssClass = "SP_dataLabel"; if (width > 0) { bf.ItemStyle.Width = Unit.Percentage(width); } bf.ItemStyle.Wrap = col.wrap; bf.ItemStyle.HorizontalAlign = col.horizontalAlign; if (col.dataFormat.Length > 0) { bf.DataFormatString = col.dataFormat; } return(bf); }
protected void btnLogon_Click(object sender, System.EventArgs e) { string adPath = System.Configuration.ConfigurationManager.AppSettings["DefaultServer"]; string domainName = System.Configuration.ConfigurationManager.AppSettings["DefaultDomain"]; SunGard.Global.DirectoryServices.LdapAuthentication adAuth = new SunGard.Global.DirectoryServices.LdapAuthentication(adPath); LogonAuthenticator adAuthenticator = new LogonAuthenticator(adPath, domainName, adAuth); Guid cacheGuid = new Guid("00000000-0000-0000-0000-000000000001"); try { if (adAuthenticator.DoLogin(txtUserName.Text, txtPassword.Text, cacheGuid)) { Response.Redirect(FormsAuthentication.GetRedirectUrl(txtUserName.Text, false)); } } catch (Exception ex) { lblError.Visible = true; lblError.ForeColor = Color.White; lblError.Font.Size = FontUnit.Point(10); lblError.Text = ex.Message; } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); Save += btnOk_Click; mHiddenFieldId = Request.QueryString["hiddenId"]; mFontTypeId = Request.QueryString["fontTypeId"]; if (!RequestHelper.IsPostBack()) { FillFontStyleListBox(); string fontType = WindowHelper.GetItem(mHiddenFieldId) as string; if (fontType != null) { string[] fontParams = fontType.Split(new [] { ';' }); if (fontParams.Length == 5) { txtFontType.Text = fontParams[0]; lstFontStyle.SelectedValue = fontParams[1].ToLowerCSafe(); txtFontSize.Text = fontParams[2]; chkUnderline.Checked = fontParams[3].EqualsCSafe("underline", true); chkStrike.Checked = fontParams[4].EqualsCSafe("strikethrought", true); } } FillFontSizeListBox(); FillFontTypeListBox(); } else { txtFontSize.Text = lstFontSize.SelectedValue; txtFontType.Text = lstFontType.SelectedValue; } ListItem li = lstFontStyle.SelectedItem; if (li != null) { txtFontStyle.Text = li.Text; } // Setup sample text lblSampleText.Font.Name = txtFontType.Text; lblSampleText.Font.Size = FontUnit.Point(ValidationHelper.GetInteger(txtFontSize.Text, 11)); lblSampleText.Font.Strikeout = chkStrike.Checked; lblSampleText.Font.Underline = chkUnderline.Checked; if (txtFontStyle.Text.ToLowerCSafe().Contains("bold")) { lblSampleText.Font.Bold = true; } if (txtFontStyle.Text.ToLowerCSafe().Contains("italic")) { lblSampleText.Font.Italic = true; } }
protected void cmdUpdate_Click(object sender, EventArgs e) { //update the color pnlCard.BackColor = Color.FromName(lstBackColor.SelectedItem.Text); //update font lblGretting.Font.Name = lstFontName.SelectedItem.Text; if (int.Parse(txtFontSize.Text) > 0) { lblGretting.Font.Size = FontUnit.Point(int.Parse(txtFontSize.Text)); } // find the appropiate TypeConverter for the BorderStyle enumeration TypeConverter converter = TypeDescriptor.GetConverter(typeof(BorderStyle)); // update the border style using the value from converter pnlCard.BorderStyle = (BorderStyle)converter.ConvertFromString(lstBorder1.SelectedItem.Text); //update pic if (chkPicture.Checked) { imgDefault.Visible = true; } else { imgDefault.Visible = false; } lblGretting.Text = txtGreeting.Text; //My first change to be commited to the local repo. }
protected void cmdUpdate_Click(object sender, EventArgs e) { // Update the color. pnlCard.BackColor = Color.FromName(lstBackColor.SelectedItem.Text); // Update the font. lblGreeting.Font.Name = lstFontName.SelectedItem.Text; if (Int32.Parse(txtFontSize.Text) > 0) { lblGreeting.Font.Size = FontUnit.Point(Int32.Parse(txtFontSize.Text)); } // Update the border style. This requires two conversion steps. // First, the value of the list item is converted from a string // into an integer. Next, the integer is converted to a value in // the BorderStyle enumeration. int borderValue = Int32.Parse(lstBorder.SelectedItem.Value); pnlCard.BorderStyle = (BorderStyle)borderValue; // Update the picture. if (chkPicture.Checked) { imgDefault.Visible = true; imgDefault.ImageUrl = "1.jpg"; } else { imgDefault.Visible = false; } // Set the text. lblGreeting.Text = txtGreeting.Text; }
/// <summary> /// Build a table listing the claims accepted about the identity. /// </summary> /// <param name="claimsIdentity">Given identity</param> private void ShowClaimsFromClaimsIdentity(IClaimsIdentity claimsIdentity) { // build table and header row Table table = new Table(); TableHeaderCell thc1 = new TableHeaderCell(); thc1.Text = "Claim Type"; TableHeaderCell thc2 = new TableHeaderCell(); thc2.Text = "Claim Value"; TableHeaderCell thc3 = new TableHeaderCell(); thc3.Text = "Value Type"; TableHeaderCell thc4 = new TableHeaderCell(); thc4.Text = "Subject Name"; TableHeaderCell thc5 = new TableHeaderCell(); thc5.Text = "Issuer Name"; TableHeaderRow th = new TableHeaderRow(); th.Controls.Add(thc1); th.Controls.Add(thc2); th.Controls.Add(thc3); th.Controls.Add(thc4); th.Controls.Add(thc5); th.BorderWidth = 1; th.BorderColor = System.Drawing.Color.Chocolate; // add a row for each claim table.Controls.Add(th); foreach (Claim claim in claimsIdentity.Claims) { // Before showing the claims validate that this is an expected claim // If it is not in the expected claims list then don't show it if (ExpectedClaims.Contains(claim.ClaimType)) { WriteClaim(claim, table); } } // add the table to the returned page table.BorderWidth = 1; table.Font.Name = "Franklin Gothic Book"; table.Font.Size = FontUnit.Point(10); table.CellPadding = 3; table.CellSpacing = 3; table.BorderColor = System.Drawing.Color.Chocolate; Label labelTitle = new Label(); labelTitle.Text = "Claims from IClaimsIdentity"; this.Controls.Add(labelTitle); this.Controls.Add(table); }
protected void ControlChangedFontSize(object sender, EventArgs e) { if (Int32.Parse(txtFontSize.Text) > 0) { lblGreeting.Font.Size = FontUnit.Point(Int32.Parse(txtFontSize.Text)); } }