Krypton-Suite / Standard-Toolkit

An update to Component factory's krypton toolkit to support .NET Framework 4.6.2 - 4.8.1 to .NET 8 - 9
BSD 3-Clause "New" or "Revised" License
411 stars 62 forks source link

[Question]: how to put "close button" inside the docking tab ? #1797

Closed blackholeearth closed 3 weeks ago

blackholeearth commented 1 month ago

how to enable close button inside the docking tab ?

-------- SOLVED : -> HERE --------

trying to put close button here

İm using demo repo: Docking customized example.... https://github.com/Krypton-Suite/Standard-Toolkit-Demos/blob/master/Source/Krypton%20Docking%20Examples/Docking%20Customized/

giduac commented 1 month ago

Hi @blackholeearth,

Can you please post a simple sample program that demonstrates the error.

Thanks.

PWagner1 commented 1 month ago

Hi @blackholeearth

Please have a look at the ContextLogic property

blackholeearth commented 1 month ago

I Searched this repo for ContextLogic . 0 result coming up ??


İ tried demos repo. When right click on a tab. Menu shows. İt says "close this button.. ...Key+Combo" Thats nice but.. İts not obvious for users..

giduac commented 1 month ago

So it's working now on your side?

PWagner1 commented 1 month ago

@blackholeearth What control are you using?

giduac commented 1 month ago

@PWagner1

His approach produces the question already and a screenshot won't cut it in this case. @blackholeearth should provide a simple example to take out all the guess work....

Smurf-IV commented 1 month ago

how to enable close button inside the docking tab ?

The following example code will allow "any" ButtonSpec to be used (i.e. one of them is a close): image

PWagner1 commented 1 month ago

Hi @blackholeearth

Have you looked at the ButtonSpec properties?

PWagner1 commented 1 month ago

Hi @blackholeearth

Just curious, what version of the toolkit are you currently using?

blackholeearth commented 1 month ago

[SOLVED] - got it working. 🎉 👏 - #FAQ-able

[ Thanks ---Smurf-IV , PWagner1---- ... buttonspec got me on right track. ]

close button better

i used the demo Project: "docking Customized" . modified on it. this code is added into the form1_load :


//page2
var kpage2 = NewDocument();
//buttonSpec puts close button, 
ButtonSpecAny bs2 = new ButtonSpecAny() {
   Style = PaletteButtonStyle.Form,
   Type = PaletteButtonSpecStyle.Close,
   Tag = "",
};
bs2.Click += (s1, e1) => { kryptonDockingManager.RemovePage(kpage1, true); };
kpage2.ButtonSpecs.Add(bsa);

kryptonDockingManager.AddToWorkspace("Workspace", new[] { kpage1, kpage2, NewDocument(), });
blackholeearth commented 1 month ago

one question.??
can we make this click_event free from external referance. ("kryptonDockingManager" and kpage2)

current: bsa2.Click += (s1, e1) => { kryptonDockingManager.RemovePage(kpage2, true); };

expected: bsa2.Click += (s1, e1) => { (KryptonPage )s1.close() };

if possible, i dont event want to write click event.?


Just curious, what version of the toolkit are you currently using?

i am using the latest one, from the demo repository . vs2019 , net4.8

giduac commented 3 weeks ago

Looks answered, so closing...