Categories > Coding > C# >

Closing an unselected tab in WPF

ExtractDev

Extract

Posts: 14

Threads: 4

Joined: Mar, 2021

Reputation: 0

Posted

I was wondering how to close a tab that's not selected.

 

For example, I have tab 1 and tab 2. I have tab 2 selected but I want to close tab 1 using its close button if that makes sense.

 

So tabs.Items.Remove(tabs.SelectedItem) won't work.

  • 0

charsss

Posts: 1477

Threads: 95

Joined: Oct, 2019

Reputation: 103

Replied

What Do You Mean Close? Also Your Code Removes The Currently Selected Not Previous

  • 0

Posts: 1008

Threads: 66

Joined: Sep, 2021

Reputation: 20

Replied

let me guess. you skidded sentinel tabs. skids dont deserve help

  • 0

"Building blocks of imagination, united in the virtual realm, where creativity thrives and friendships ignite. Welcome to the Roblox revolution!" - chatgpt

 

ExtractDev

Extract

Posts: 14

Threads: 4

Joined: Mar, 2021

Reputation: 0

Replied

@ImmuneLion318 like removing the tab that isn't selected by pressing an X button on it.

  • 0

charsss

Posts: 1477

Threads: 95

Joined: Oct, 2019

Reputation: 103

Replied

Just Learn Basic C# And Even At That Why Let User Close Other Tabs I Just Let Close Currently Selected.

  • 0

ExtractDev

Extract

Posts: 14

Threads: 4

Joined: Mar, 2021

Reputation: 0

Replied

@ImmuneLion318 Alright I'll just make it close the current tab, I just didn't want the exploit closing the current tab when the user wanted to close another one.

  • 0

charsss

ecstacy_lxnny

yea i'm lxnny

vip

Posts: 941

Threads: 84

Joined: May, 2021

Reputation: 98

Replied

@crazy_cat If you don't help skids, they will never have the possibility to learn

 

  • 0

im bipolar btw

Users viewing this thread:

( Members: 0, Guests: 1, Total: 1 )