Forum > Coding >

Closing an unselected tab in WPF

ExtractDev

Extract

Posts: 10

Threads: 2

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

Threads: 72

Joined: Oct, 2019

Reputation: 89

Replied

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

  • 0

Posts: 793

Threads: 54

Joined: Sep, 2021

Reputation: 21

Replied

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

  • 0

dead inside

ExtractDev

Extract

Posts: 10

Threads: 2

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

Threads: 72

Joined: Oct, 2019

Reputation: 89

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

Threads: 2

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

fka as delta

contentCreator

Posts: 764

Threads: 69

Joined: May, 2021

Reputation: 95

Replied

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

 

  • 0

fka as delta

Users viewing this thread:

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