BreadCrumbs Control: Final Touches and Demo Project
 

by Sameera on February 15, 2008 21:08

After weeks of inactivity, I finally managed to get a demo project in place for the BreadCrumbs controls. You can download it here. The code includes few updates I have made since the last version. For the sake of flexibility, I have kept the basic control as simple as possible. In the demo, I have added few additional helper classes to provide the full functionality desired.

Extending the control is pretty simple too. For instance, to display the menus for each of the sub items in a list item, you handle the SubItemClicked event. The SubItemClickedEventArgs passed to you along with this event provides you with the row index, column index and the bottom-left corner pixel coordinates of the sub item. In the demo app, this event handled as;

[code:c#]
void ListBox_SubItemClicked(object sender, BreadCrumbsListBox.SubItemClickedEventArgs e)
{
    ContextMenuStrip menu = null;
    if (e.ColumnIndex == 1 && breadCrumbsList.ListBox.SelectedItem != null)
        menu = GetTemplateMenu(breadCrumbsList.ListBox.SelectedIndex);
    else
        menu = _entityMenu;
    menu.Show(breadCrumbsList, breadCrumbsList.PointToClient(e.BottomLeftCorner));
}
[/code]

Here, the _entityMenu is a pre-constructed menu while as the "Template Menu" is reconstructed every time based on the selection.

Add comment


(Will show your Gravatar icon)  

biuquote
  • Comment
  • Preview
Loading



About Me

Sameera Perera

Sameera Perera

Log in

RecentComments

Comment RSS

Calendar

<<  November 2008  >>
MoTuWeThFrSaSu
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

Archive

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008

All forms of source code published on Codoxide.com are distributed under the Apache License, Version 2.0 unless otherwise stated.
The rest of the content are published under a Creative Commons Attribution 3.0 License.
Creative Commons License

CodoxideTM

Copyright © 2008  codoxide.com. All rights reserved. Designed by Sameera Perera