When i was working on ASP.NET application, one requirment was to have Resizable TextBox. I searched it and found in AjaxControlToolKit, but AjaxControlToolKit has Resizable Control which is actully a no editable container. Reforming this control to Resizable TextBox as UserControl is all about this article. Again i am taking code provided by Microsoft, which is easily available here. Step:1 Add reference of AjaxControlToolKit to your application. Create a user control name "ResizableTextBox" and add it to your project. Now place ResizableControlExender tag with textbox which should be within panel.
<asp:Panel ID="PanelText" runat="server" CssClass="frameText" ><asp:TextBox runat="server" ID="TextBoxResizable" CssClass="noborder" Width="100%" Height="100%" TextMode="MultiLine"></asp:TextBox></asp:Panel> <cc1:ResizableControlExtender ID="ResizableTextBoxExtender" runat="server" TargetControlID = "PanelText" ResizableCssClass="resizingText" HandleCssClass="handleText" OnClientResizing = "OnClientResizeText" />
// Get or Set textbox's textpublic string Text{ get { return this.TextBoxResizable.Text; } set { this.TextBoxResizable.Text = value; }} // Set minimum height of text boxpublic string MinimumHeight{ get { return this.ResizableTextBoxExtender.MinimumHeight.ToString(); } set { this.ResizableTextBoxExtender.MinimumHeight = int.Parse(value); }} // Set minimum width of text boxpublic string MinimumWidth{ get { return this.ResizableTextBoxExtender.MinimumWidth.ToString(); } set { this.ResizableTextBoxExtender.MinimumWidth = int.Parse(value); }} // Set maximum height of text boxpublic string MaximumHeight{ set { this.ResizableTextBoxExtender.MaximumHeight = int.Parse(value); }} // Set maximum width of text boxpublic string MaximumWidth{ set { this.ResizableTextBoxExtender.MaximumWidth = int.Parse(value); }}
<uc1:ResizableTextBoxControl id="ResizableTextBoxControl1" MinimumHeight="50" MinimumWidth="100" MaximumHeight="300" MaximumWidth="400" runat="server"></uc1:ResizableTextBoxControl>
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: