How to remove the default margin on the content of a wpf TabItem in C# Code -


i'm using tabcontrol class in wpf , i've noticed content of each tabitem has default margin of 4 pixels on sides.

i'm building tab control dynamically in c# code, i've seen xaml solution below. how achievable in c# code or templating.

<tabitem>   <grid margin="-4">   </grid> <tabitem> 

tab border

you have assign grid id, example (pertinent case):

  <grid name ="grd">   </grid> 

then apply margin spec following:

grd.margin = new thickness(-4); 

also, can use variation of syntax:

grd.margin = new thickness(-4,-4,-4,-4); 

the same technique can apply other controls. read more on topic (wpf margin) at: https://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.margin.aspx

hope help.


Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -