Forum > Coding >

Add Style to TabControl in C#

Unidentified

nobody do wut i do

Posts: 320

Threads: 9

Joined: Feb, 2021

Reputation: 2

Posted

Edit: My dumbass said TabControl, i meant TabItem

 

I am trying to add an close tab button to my TabItem. I tried some tutorials and they worked fine but i want to apply an style to the TabItem in C#. I tried

Style style = Application.Current.FindResource("tabItemStyle") as Style;

But it gave me an Error saying it can't find the Style. How do I get it to work?

  • 0

Learning C++, C#, JavaScript Developer

I develop random stuff

Discord: Unidentified#1091

Ducxy

solinym

vip

Posts: 565

Threads: 86

Joined: Mar, 2019

Reputation: 37

Replied

this.Style = Resources["ResourceName"] as Style;

make sure that capitalization is correct and that the resource is accessible ofc.

  • 0

a mysterious creature from the past

Users viewing this thread:

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