Profile Picture

NNavigationPane event on Collapse and expand

Posted By Rudi Groenewald 13 Years Ago
Author
Message
Rudi Groenewald
questionmark Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 9, Visits: 2
Hi there,

Is there an event that is being raised when the panel is being collapsed / expanded? I need to write some code on the event. Also, is there a property to know if the panel is collapsed or expanded? I can only see "IsCollapseable", but I don't think this will help for what I need.


My Scenario:

I placed a NNavigationPane Fill Docked into a ShadowDecorator. The Shadowdecorator is docked to the left of the form. When collapsing the panel, the shadowdecorator doesnt "reduce / collapse" with the panel, it stays full width, so now I want to write some code in order to collapse the shadowdecorator, and I also want to save the position of the panel as settings of the user's preference (Generate form with it collapsed)


Any ideas?



Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)

Group: Forum Members
Last Active: 5 hours ago
Posts: 3,043, Visits: 3,777
Hi Rudi,

Currently there is no such event, but you can override OnStateChanged method and put your resizing logic there.

public class MyNNavigationPane : NNavigationPane
   {
      protected override void OnStateChanged()
      {
         base.OnStateChanged();      
         //Resize the Parent control (NShadowDecorator) here.
      }
   }

To obtain whether the navigation pane is collapsed or expanded you should get the value of State property. IsCollapsable property determines whether the control can be collapsed or no.

I hope this helps.


Best Regards,
Nevron Support Team



Rudi Groenewald
Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 9, Visits: 2
ok this probably is gonna sound very silly... I just wanted to see if this will trigger, and it doesnt seem to trigger when I actually click on the collapse button. I tried this in a new class file.


Imports Nevron.UI.WinForm.Controls


Public Class MyNNavigationPane
Inherits NNavigationPane

Protected Overrides Sub OnStateChanged()
MyBase.OnStateChanged()

MsgBox("State Changed ")

End Sub
End Class


any ideas?




Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)

Group: Forum Members
Last Active: 5 hours ago
Posts: 3,043, Visits: 3,777
Hi Rudi,

Have you change the type of the control from NNavigationPane to MyNNavigationPane in the designer generated code?


Best Regards,
Nevron Support Team



Rudi Groenewald
Posted 13 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)Forum Newbie (9 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 9, Visits: 2
nope, kept it the same...

My navigation pane on the form is called NNavigationPane1




Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)Supreme Being (4,350 reputation)

Group: Forum Members
Last Active: 5 hours ago
Posts: 3,043, Visits: 3,777
Hi Rudi,

You should change the type of the control in the designer generated code to the new type.
Currently, you don't actually use this inherited control.

Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic