Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Need some tips to improve my Navigation control

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':

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
Really cool and neat. Are there design time options for in the designer as well?
Looks very nice bud. :) Reminds me of the navigation from WordPress. Here's an idea, you can have an option like WP does where the navigation is "minimized" and only the icons are visible. Basically just a nice little feature to free up some space on your form during run-time. Wouldn't be hard to implement either. Just a width resize on all your "nodes". Anyway, good job!
Need a custom software? Check out my freelance service here! 6+ years and counting, never a complaint :)

STOP STEALING CODE.

FREE NATHAN

People who report posts are lamers.
Good job reminds me of my Sarrow Tab selector. And I can understand how much of a b*tch it is to get everything located right and looking right. Great Job.
(Nov 3, 2016 03:32 PM)Ninja Wrote:  Really cool and neat. Are there design time options for in the designer as well?

Thx bro. This was planned for using myself. But I could try to add some options in the VS IDE designer.

(Nov 3, 2016 03:40 PM)idb. Wrote:  Looks very nice bud. :) Reminds me of the navigation from WordPress. Here's an idea, you can have an option like WP does where the navigation is "minimized" and only the icons are visible. Basically just a nice little feature to free up some space on your form during run-time. Wouldn't be hard to implement either. Just a width resize on all your "nodes". Anyway, good job!

In fact the demos I posted in #1 are the WP Admin Tool "look & feel" but in WinForms. 🙂
I will check for this feature you posted.

Added a new Demo 5 in #1 post.

I hope to work in the control this weekend (cleaning the code and some refactoring) to release the source code (GitHub) as soon as possible.

Waiting for more features.

Thx in advance.
Very nice, and wicked to see some originality and something useful! Keep up the hardwork bro :p
(Nov 4, 2016 12:47 PM)Zilog80 Wrote:  Thx bro. This was planned for using myself. But I could try to add some options in the VS IDE designer.

I was thinking like a normal tabcontrol you can click the tiny arrow and a panel appears where you can add and remove tabs.
Im waiting for the release! Looks really awesome


Possibly Related Threads...
Thread / Author Replies Views Last Post
[.NET] by edin_Jan 25, 2018 11:55 AM 4 303 Jan 25, 2018 11:55 AM
Last Post: Ninja
[C#] by DotexeDec 31, 2017 09:00 AM 7 294 Dec 31, 2017 09:00 AM
Last Post: Dotexe
[.NET] by Zilog80Nov 10, 2017 07:39 AM 42 3,196 Nov 10, 2017 07:39 AM
Last Post: hydra11