Exemplo n.º 1
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            this.Attributes.Add("onchange", "SetButton(this,'select');");
            RightListBox.Attributes.Add("onchange", "SetButton(this,'select');");
            RightListBox.Width  = this.Width;
            RightListBox.Height = this.Height;
            //左側List註冊雙擊事件
            this.Attributes.Add("onDblClick", "Add(this,'toRight',false);");
            //右側List註冊雙擊事件
            this.RightListBox.Attributes.Add("onDblClick", "Add(this,'toLeft',false);");

            writer.Write("<table  border=\"0\" cellspacing=\"3\" cellpadding=\"0\"><tr><td>");
            base.Render(writer);
            StringBuilder codeBuilder = new StringBuilder();

            codeBuilder.AppendLine("</td>");
            codeBuilder.AppendLine("<td width=\"10\"><table  border=\"0\" cellspacing=\"13\" cellpadding=\"0\">");
            codeBuilder.AppendLine("<tr>");
            // codeBuilder.AppendLine("<td><input class='btn' style=\"width:30px\" type=\"button\" name=\"Submit\" value=\">\" src=\"~/Common/images/SinglearrowRight.gif\" onClick=\"Add(this,'toRight',false);\" disabled=\"disabled\" /></td>");
            codeBuilder.AppendLine("<td><img id=\"Submit\" src=\"../../Theme/images/SinglearrowRight.gif\" alt=\"\" onclick=\"Add(this,'toRight',false);\" /></td>");
            codeBuilder.AppendLine("</tr>");
            codeBuilder.AppendLine("<tr>");
            // codeBuilder.AppendLine("<td><input class='btn' style=\"width:30px\" type=\"button\" name=\"Submit2\" value=\"<\"  onClick=\"Add(this,'toLeft',false);\" disabled=\"disabled\" /></td>");
            codeBuilder.AppendLine("<td><img id=\"Submit2\" src=\"../../Theme/images/SinglearrowLeft.gif\" alt=\"\" onClick=\"Add(this,'toLeft',false);\" /></td>");
            codeBuilder.AppendLine("</tr>");
            codeBuilder.AppendLine("<tr>");
            // codeBuilder.AppendLine("<td><input class='btn' style=\"width:30px\" type=\"button\" name=\"Submit3\" value=\">>\"  onClick=\"Add(this,'toRight',true);\" /></td>");
            codeBuilder.AppendLine("<td><img id=\"Submit3\" src=\"../../Theme/images/arrowRight.gif\" alt=\"\" onClick=\"Add(this,'toRight',true);\" /></td>");
            codeBuilder.AppendLine("</tr>");
            codeBuilder.AppendLine("<tr>");
            // codeBuilder.AppendLine("<td><input class='btn' style=\"width:30px\" type=\"button\" name=\"Submit4\" value=\"<<\" onClick=\"Add(this,'toLeft',true);\" /></td>");
            codeBuilder.AppendLine("<td><img id=\"Submit3\" src=\"../../Theme/images/arrowLeft.gif\" alt=\"\"  onClick=\"Add(this,'toLeft',true);\" /></td>");
            codeBuilder.AppendLine("</tr>");
            codeBuilder.AppendLine("<tr><td>");
            writer.Write(codeBuilder.ToString());
            codeBuilder.Remove(0, codeBuilder.Length);
            AddedBox.RenderControl(writer);
            DeletedBox.RenderControl(writer);
            codeBuilder.AppendLine("</td></tr>");
            codeBuilder.AppendLine("</table></td>");
            codeBuilder.AppendLine("<td>");
            writer.Write(codeBuilder.ToString());
            codeBuilder.Remove(0, codeBuilder.Length);
            RightListBox.RenderControl(writer);
            codeBuilder.AppendLine("</td>");
            codeBuilder.AppendLine("</tr>");
            codeBuilder.AppendLine("</table>");
            writer.Write(codeBuilder.ToString());
        }
Exemplo n.º 2
0
        protected override void Render(System.Web.UI.HtmlTextWriter writer)
        {
            this.Attributes.Add("onchange", "SetButton(this,'select');");
            RightListBox.Attributes.Add("onchange", "SetButton(this,'select');");
            RightListBox.Width  = this.Width;
            RightListBox.Height = this.Height;

            writer.Write("<table  border=\"0\" cellspacing=\"3\" cellpadding=\"0\"><tr><td>");
            base.Render(writer);
            StringBuilder codeBuilder = new StringBuilder();

            codeBuilder.AppendLine("</td>");
            codeBuilder.AppendLine("<td width=\"10\"><table  border=\"0\" cellspacing=\"3\" cellpadding=\"0\">");
            codeBuilder.AppendLine("<tr>");
            codeBuilder.AppendLine("<td><input type=\"button\" name=\"Submit\" value=\" △ \" onClick=\"Add(this,'toRight',false);\" disabled=\"disabled\" /></td>");
            codeBuilder.AppendLine("</tr>");
            codeBuilder.AppendLine("<tr>");
            codeBuilder.AppendLine("<td><input type=\"button\" name=\"Submit2\" value=\" ■ \"  onClick=\"Add(this,'toLeft',false);\" disabled=\"disabled\" /></td>");
            codeBuilder.AppendLine("</tr>");
            codeBuilder.AppendLine("<tr>");
            codeBuilder.AppendLine("<td><input type=\"button\" name=\"Submit3\" value=\" △|\"  onClick=\"Add(this,'toRight',true);\" /></td>");
            codeBuilder.AppendLine("</tr>");
            codeBuilder.AppendLine("<tr>");
            codeBuilder.AppendLine("<td><input type=\"button\" name=\"Submit4\" value=\"|■ \" onClick=\"Add(this,'toLeft',true);\" /></td>");
            codeBuilder.AppendLine("</tr>");
            codeBuilder.AppendLine("<tr><td>");
            writer.Write(codeBuilder.ToString());
            codeBuilder.Remove(0, codeBuilder.Length);
            AddedBox.RenderControl(writer);
            DeletedBox.RenderControl(writer);
            codeBuilder.AppendLine("</td></tr>");
            codeBuilder.AppendLine("</table></td>");
            codeBuilder.AppendLine("<td>");
            writer.Write(codeBuilder.ToString());
            codeBuilder.Remove(0, codeBuilder.Length);
            RightListBox.RenderControl(writer);
            codeBuilder.AppendLine("</td>");
            codeBuilder.AppendLine("</tr>");
            codeBuilder.AppendLine("</table>");
            writer.Write(codeBuilder.ToString());
        }