<%@ Control Language="c#" AutoEventWireup="false" %>
<%@ Import Namespace="ASPNETExpert.WebControls.Style" %>
<%@ Register TagPrefix="ec" Namespace="ASPNETExpert.WebControls" Assembly="ASPNETExpert.WebControls" %>
<%@ Register TagPrefix="ecd" Namespace="ASPNETExpert.WebControls.DemoControls" Assembly="ASPNETExpert.WebControls.DemoControls" %>
<script language="C#" runat="server">
private void ChangeShortcut_Click(object sender, EventArgs e)
{
KeyboardEnabledTree.AccessShortcut = KeyboardShortcut.Parse(AccessShortcut.Text);
}
</script>
<table cellpadding="0" cellspacing="0" border="0" xmlns:ec="urn:http://aspnetexpert.com/ExpertControls.xsd">
<tr>
<td>
<ec:ExpertTree id="KeyboardEnabledTree" runat="server" AccessShortcut-Ctrl="true" AccessShortcut-Key="F2" EnableViewState="false" ExpandOnClick="true" CollapseOnClick="true">
<TreeLook Width="260" Height="320px" Overflow="Scroll" Border-Style="Solid" Border-Width="1px" Border-Color="White" FocusedLook-Border-Style="Dotted" FocusedLook-Border-Width="1px" FocusedLook-Border-Color="#DEDEDE" />
<Looks>
<ec:TreeNodeLook Runat="server" Id="Parent" BindStrategy="AutoBind">
<InitLook>
<ExpandButton Width="11px" Height="11px" ImageResourceUrl="XP.ExpandButton.gif" />
<NodeIcon Width="16px" Height="16px" Padding-Left="3px" Padding-Right="3px" />
<TextSection ForeColor="Black" Font-Name="Tahoma,Verdana,Arial" Font-Size="12px" Padding-Top="2px" Padding-Left="5px" Padding-Bottom="2px" Padding-Right="5px" Cursor="Default" />
</InitLook>
<HoveredLook>
<TextSection ForeColor="#000066" Font-Name="Tahoma,Verdana,Arial" Font-Size="12px" Font-Decoration="Underline" />
</HoveredLook>
<ExpandedLook>
<ExpandButton Width="11px" Height="11px" ImageResourceUrl="XP.CollapseButton.gif" />
</ExpandedLook>
<SelectedLook>
<TextSection ForeColor="White" Background-Color="#2060C0" Padding-Top="1px" Padding-Left="4px" Padding-Bottom="1px" Padding-Right="4px" Border-Style="Dotted" Border-Color="#CE953A" Border-Width="1px" />
</SelectedLook>
<SelectedHoveredLook>
<TextSection ForeColor="White" Background-Color="#2060C0" Padding-Top="1px" Padding-Left="4px" Padding-Bottom="1px" Padding-Right="4px" Border-Style="Dotted" Border-Color="#CE953A" Border-Width="1px" Font-Name="Tahoma,Verdana,Arial" Font-Size="12px" Font-Decoration="Underline" />
</SelectedHoveredLook>
<DisabledLook>
<TextSection ForeColor="#808080" />
</DisabledLook>
<BindCriteria>
<ec:PropertyValueCriteria Property="HasChildren" Value="true" />
</BindCriteria>
</ec:TreeNodeLook>
</Looks>
<Nodes>
<ec:TreeNode Expanded="true" Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/Desktop.gif" Text="Desktop">
<Nodes>
<ec:TreeNode Expanded="true" Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/MyDocuments.gif" Text="My Documents">
<Nodes>
<ec:TreeNode Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/MyMusic.gif" Text="My Music" />
<ec:TreeNode Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/MyPictures.gif" Text="My Pictures" />
</Nodes>
</ec:TreeNode>
<ec:TreeNode Expanded="true" Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/MyComputer.gif" Text="My Computer">
<Nodes>
<ec:TreeNode Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/FloppyDrive.gif" Text="31/2 Floppy (A:)" />
<ec:TreeNode Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/LocalDrive.gif" Text="Local Disk (C:)" />
<ec:TreeNode Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/LocalDrive.gif" Text="New Volume (D:)" />
</Nodes>
</ec:TreeNode>
<ec:TreeNode Expanded="true" Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/ControlPanel.gif" Text="Control Panel">
<Nodes>
<ec:TreeNode Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/AdminTools.gif" Text="Administrative Tools" />
<ec:TreeNode Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/Fonts.gif" Text="Fonts" />
<ec:TreeNode Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/NetworkConn.gif" Text="Network Connections" />
<ec:TreeNode Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/PrintersAndFaxes.gif" Text="Printers And Faxes" />
<ec:TreeNode Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/ScannersAndCameras.gif" Text="Scanners And Cameras" />
<ec:TreeNode Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/ScheduledTasks.gif" Text="Scheduled Tasks" />
</Nodes>
</ec:TreeNode>
<ec:TreeNode Look-InitLook-NodeIcon-ImageUrl="../images/Explorer/RecycleBin.gif" Text="Recycle Bin" />
</Nodes>
</ec:TreeNode>
</Nodes>
</ec:ExpertTree>
</td>
<td valign=top width="100%" style="padding-left:10px;">
<ecd:DescriptionView runat="server" ID="Descriptionview1">
<ecd:Description id="Description1" runat="server">
Use <b>AccessShortcut</b> property to assign an access shortcut key that
allows to quickly move to the tree. Use <b>Tab</b> and other navigation
keys to navigate the trees on the page. Use <b>Enter</b> to select a node.
</ecd:Description>
<ecd:Description id="Description2" runat="server">
Type one or more letters to select the node that starts with that letter
or letters, case-insensitive.
</ecd:Description>
<ecd:Description id="Description3" runat="server">
Set <b>KeyboardEnabled</b> boolean property to specify whether to enable keyboard
navigation in the tree. Keyboard navigation is enabled by default.
</ecd:Description>
<ecd:Description id="Description4" runat="server">
Use <b>AccessShortcut</b> property to define a tree access key.
You can set <b>Alt</b>, <b>Ctrl</b>, <b>Shift</b> flags as well as assign a letter, a digit,
<b>Ins</b>, <b>Del</b>, <b>BkSp</b>, <b>F1-F12</b> keys.
</ecd:Description>
<ecd:Description id="Description5" runat="server">
Use <b>FocusedLook</b> property to specify a bordered look to use for the tree frame
when it has keyboard focus.
</ecd:Description>
</ecd:DescriptionView>
</td>
</tr>
<tr>
<td colspan="2">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="formtext">Enter tree's <b>Access Shortcut</b>:</td>
<td class="formtext"><asp:TextBox Runat=server ID="AccessShortcut">Ctrl+F2</asp:TextBox></td>
<td class="formtext"><asp:Button Runat=server ID="ChangeShortcut" Text="Change" OnClick="ChangeShortcut_Click"></asp:Button></td>
</tr>
</table>
</td>
</tr>
</table>
<ec:CodeViewTab id="CodeViewTab1" runat="server">
<ec:TabItem runat="server" Text="aspx" ID="Tabitem1">
<pre class="aspcode">
<ecd:SyntaxHighlight runat="server" ContentType="ASPX" OutputFile="Advanced/Keyboard.ascx" ID="Syntaxhighlight1"/>
</pre>
</ec:TabItem>
</ec:CodeViewTab>