Ajax DropShadow Extender Control in VB.NET

With the help of this control we can define background and curved cornersin the panel.
  • 2654

Introduction

DropShadow Extender Control is apply on Panel control with the help of Opacity. we want to use background shadow and curved corners in a Panel then apply DropShadow Exrender Control .

DropShadow Extender properties.

  • BehaviourID.
  • Opacity.
  • Radious.
  • Rounded.
  • TargetControlID.
  • TrackPosition.

Step 1 : Open visual studio and go to file menu option.

  • Select ASP.NET Web Site.
  • Default.aspx page open.

ASP-page1.gif

Step 2 : Go to Solution Explorer and right click.

  • Select Add New Items.
  • Selct Web Form option and add .
  • Go to source option in page .
  • Drag and drop control in Ajax Control ToolKit.

webforms.gif

Code :

<title> SIMPLE APPLICATION WITH AJAX CONTROL</title>
</head>
<
body>
    <form id = "form1" runat="server">
<div>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:Panel ID="Panel1" runat="server" BackColor ="Aqua">
    <asp:Label ID="Label1" runat="server" Text="Name" ></asp:Label>
    <asp:TextBox ID="TextBox1" runat="server" BackColor ="Red" ></asp:TextBox>
    <br />
 <asp:Label ID="Label2" runat="server" Text="Mcn" BackColor ="Red" ></asp:Label>
    <asp:TextBox ID="TextBox2" runat="server" BackColor ="Aquamarine" ></asp:TextBox>
        <br />
        <br />
    </asp:Panel>
    <table><tr><td>Show Shadow:</td><td>
<
asp:CheckBox ID="CheckBox1" runat="server" AutoPostBack="True"  OnCheckedChanged ="CheckBox1_CheckedChanged" BackColor ="Red" />  </td></tr><tr>
                    <td>Rounded:</td><td>
   <asp:CheckBox ID="CheckBox2" runat="server" AutoPostBack="True" OnCheckedChanged = "CheckBox2_CheckedChanged" BackColor ="Blue"/>                 </td></tr></table>
<
asp:DropShadowExtender ID="DropShadowExtender1" runat="server" Enabled = "true" TargetControlID = "Panel1" Opacity = "0" >    </asp:DropShadowExtender>
    </div>
    </form>
</body>
</
html>

Step : 3 Now double click in Checkbox Control and write a code.

Code :

 Protected Sub CheckBox1_CheckedChanged(sender As Object, e As System.EventArgs) Handles CheckBox1.CheckedChanged
        If CheckBox1.Checked Then
            DropShadowExtender1.Opacity = 5
        Else
            DropShadowExtender1.Opacity = 0
        End If
    End Sub
    Protected Sub CheckBox2_CheckedChanged(sender As Object, e As System.EventArgs) Handles CheckBox2.CheckedChanged
        If CheckBox2.Checked Then
            DropShadowExtender1.Rounded = True
        Else
            DropShadowExtender1.Rounded = False
        End If
End
Sub

Step 4 : Now we press F5 and find the output.

output34.gif

Step 5 : When we click in Show Shadow option then  see black line show in the panel.

black-shadow.gif

Step 6: When we click in Rounded option then no any black line show in  the Panel.

black-line--not-show.gif

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.