NNavigationPane event on Collapse and expand


Author
Message
Rudi Groenewald
Rudi Groenewald
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
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
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
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
Rudi Groenewald
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
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
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
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
Rudi Groenewald
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
Posts: 9, Visits: 2
nope, kept it the same...

My navigation pane on the form is called NNavigationPane1



Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
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


GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search