Nov 3, 2016 02:39 PM
(This post was last modified: Nov 8, 2016 02:12 PM by Zilog80.)
Side-note #1: My gif recorder software sucks, so posted gifs doesn't have 'high' quality
Side-note #2: The control is builded in run time. You can serialize the whole tree-node or simply make your own class containing all the tree-node
For Demo #1, Demo #2 and Demo #3 this is all the source code we write in our 'business logic layer':
Demo #1:
Spoiler (Click to View)
As you can see seems a themed TabControl (but isn't a TabControl), with its hover stuff and selected item.
The width (and height) is resizable in design time. So you can adjust it on your form make sense to design tool 'look & feel'
The 'tree-node' is something like:
Demo #2:
Spoiler (Click to View)
Navigation control for the win!
Viewing Demo #1 you might think: 'Oh c'mon, another themed tabcontrol'.
But really this is a Navigation control.
As you can see, when you select a main category, if that category has childs the control expands the category and show it childs (and select by default the first child)
Aditionally when you expand a node, if the selected itemt doesn't fit in control height, the control autoscrolls to ensure that item visibility. You can also use mouse scroll button to scroll up & down through de control (and without the 'ugly' vertical scroll bar)
Demo #3:
Spoiler (Click to View)
Why only one child? Making it N-childed
Sometimes we'll need some kind of hierarchy. In the Demo #3 we our tree-node is somenthing like:
Spoiler (Click to View)
Demo #4:
Spoiler (Click to View)
Making it more dynamic.
Sometimes we'll need to change our navigation control in run-time due user inputs.
Imagine user does not have licence for certain stuff. You can disable/hide this stuff in navigation control.
This can be done easily:
This will turn invisble the item with ID = 1004:
And this will disable the item with ID = 1004:
And maybe sometimes we'll need to "add new" items to control in run-time due user inputs/options, like you can see in Demo #4-
Update (11/04/2016)
Demo #5:
Spoiler (Click to View)
- Implemented a new method to select a item in run-time
- Implemented a new method to change theme in run-time
- Fixed resize width behaviour
Update (11/05/2016)
Demo #6:
Spoiler (Click to View)
- Fixed hierachy draw & autoexpand. Now you can really have N childs.
- Improve theme behaviour: Now you can define colors in theme class that draws right colors based on 'item depth'. You can define BackColor, Hover BackColor, selected item BackColor, and font brushes "by depth".
Update (11/06/2016)
Demo #7:
Spoiler (Click to View)
- Implemented a new glyph in all 'expandable childs'
What other features can i add to this control before release the source code?
Thx in advance.
Update (11/08/2016)
Source code: https://hackforums.net/showthread.php?tid=5458100
Side-note #2: The control is builded in run time. You can serialize the whole tree-node or simply make your own class containing all the tree-node
For Demo #1, Demo #2 and Demo #3 this is all the source code we write in our 'business logic layer':
PHP Code
<?php
' Somewhere (in contructor class or Form Load):
UC_NavBar1.Initialize(New NavBarModel(), New WPNavBar.ThemeSelector(WPNavBar.Theme.Dark).CurrentTheme)
Private Sub UC_NavBar1_SelectedItem(item As NavBarItem) Handles UC_NavBar1.SelectedItem
LblInfo.Text = $"CONTENT SAMPLE -> ID: {item.ID} Text: {item.Text}"
End Sub
Demo #1:
Spoiler (Click to View)
As you can see seems a themed TabControl (but isn't a TabControl), with its hover stuff and selected item.
The width (and height) is resizable in design time. So you can adjust it on your form make sense to design tool 'look & feel'
The 'tree-node' is something like:
PHP Code
<?php
items = New List(Of NavBarItem)() From
{
New NavBarItem With {.ID = x, .Text = "Desktop", Icon = New ItemIcons With {some stuff here}},
New NavBarItem With {.ID = x, .Text = "Store", Icon = New ItemIcons With {some stuff here}},
New NavBarItem With {.ID = x, .Text = "Post", Icon = New ItemIcons With {some stuff here}},
...
}
Demo #2:
Spoiler (Click to View)
Navigation control for the win!
Viewing Demo #1 you might think: 'Oh c'mon, another themed tabcontrol'.
But really this is a Navigation control.
As you can see, when you select a main category, if that category has childs the control expands the category and show it childs (and select by default the first child)
Aditionally when you expand a node, if the selected itemt doesn't fit in control height, the control autoscrolls to ensure that item visibility. You can also use mouse scroll button to scroll up & down through de control (and without the 'ugly' vertical scroll bar)
Demo #3:
Spoiler (Click to View)
Why only one child? Making it N-childed
Sometimes we'll need some kind of hierarchy. In the Demo #3 we our tree-node is somenthing like:
Spoiler (Click to View)
Demo #4:
Spoiler (Click to View)
Making it more dynamic.
Sometimes we'll need to change our navigation control in run-time due user inputs.
Imagine user does not have licence for certain stuff. You can disable/hide this stuff in navigation control.
This can be done easily:
This will turn invisble the item with ID = 1004:
PHP Code
<?php
UC_NavBar1.ItemChangeVisibility(false, 1004)
And this will disable the item with ID = 1004:
PHP Code
<?php
UC_NavBar1.ItemChangeEnable(false, 1004)
And maybe sometimes we'll need to "add new" items to control in run-time due user inputs/options, like you can see in Demo #4-
Update (11/04/2016)
Demo #5:
Spoiler (Click to View)
- Implemented a new method to select a item in run-time
- Implemented a new method to change theme in run-time
- Fixed resize width behaviour
Update (11/05/2016)
Demo #6:
Spoiler (Click to View)
- Fixed hierachy draw & autoexpand. Now you can really have N childs.
- Improve theme behaviour: Now you can define colors in theme class that draws right colors based on 'item depth'. You can define BackColor, Hover BackColor, selected item BackColor, and font brushes "by depth".
Update (11/06/2016)
Demo #7:
Spoiler (Click to View)
- Implemented a new glyph in all 'expandable childs'
What other features can i add to this control before release the source code?
Thx in advance.
Update (11/08/2016)
Source code: https://hackforums.net/showthread.php?tid=5458100


![[Image: dObe23C.gif]](https://i.imgur.com/dObe23C.gif)
![[Image: G4tvKfD.gif]](https://i.imgur.com/G4tvKfD.gif)
![[Image: Kj0dP0G.gif]](https://i.imgur.com/Kj0dP0G.gif)
![[Image: hM7T8xQ.gif]](https://i.imgur.com/hM7T8xQ.gif)
![[Image: Ls5ALDC.gif]](https://i.imgur.com/Ls5ALDC.gif)
![[Image: YLVe1mH.gif]](https://i.imgur.com/YLVe1mH.gif)
![[Image: BUUs17V.gif]](https://i.imgur.com/BUUs17V.gif)
