   [.net] Properly implementing WPF flat buttons
  A much-discussed topic online, one method I found was to use negative numbers for padding to effectively erase the border region. With an image of 50x50 where every pixel must show up exactly (1:1), a way I've found to create a flat button using that image, shown exactly 50x50, is:    BitmapImage bitmap = new BitmapImage( new Uri("BtnImage.png", System.UriKind.Relative) );    Image image = new Image( );    image.Source = bitmap;    Button button = new Button( );    button.Width = 50;    button.Height = 50;    button.Background = Brushes.Transparent;    button.BorderBrush = Brushes.Transparent;    button.HorizontalContentAlignment = HorizontalAlignment.Stretch;    button.Padding = new Thickness(-3);    button.Content = image;It so happens that a padding of -3 exactly erases the border region and results in a 50x50 image button. My question is, is this reliable or would it appear broken on some people's machines for whatever reason? It sure seems like a hack to me.   
  That looks like it's dependant on a specific button template. The templates change based on the UI theme (i.e. classic windows, XP luna, or vista/7 aero).Also, don't use an image for your button. Your button won't provide any visual feedback for mouse over or pressed states, and it's inflexible (you can't easily change the size). WPF provides pretty powerful xaml based drawing, use that instead.If you want to completely change the buttons appearance I'd recommend writing your own button template.Post a picture of what you want to achieve and I might be able to help you.;  It was a small 10x10 image button and I use a different image on mouse-over. I decided to just make it a generic UserControl since that already supports what I needed (aside from a mouse-click event which I just implemented myself).   ;  Can't you change the ControlTemplate to change this?   