Every time I run my program it will change DataGridView font sizes and color

NewAtThis

New member
Joined
Aug 9, 2021
Messages
1
Programming Experience
Beginner
I have no idea why every time I save and run my program it will change DataGridView font sizes and color? Please help me. Thank you


Changes the cell font color from black to white

1628573766046.png


Changes the size of the Column header from 11pt to 14.25pt
1628573794308.png



Column header
1628573886847.png


DefaultCellStyle
1628574048482.png
 
Last edited:

jmcilhinney

VB.NET Forum Moderator
Staff member
Joined
Aug 17, 2004
Messages
14,553
Location
Sydney, Australia
Programming Experience
10+
Firstly, please don't post the same question multiple times. You would have been told that your thread needed to be approved by a moderator so you should not have been posting the same thing three times.

As for the issue, you need to provide a FULL and CLEAR explanation of the problem for a start. You have tagged the thread "datagridview" but the title and post say "Datagrid". Just use the actual names of things and you won't create confusion. If it's a DataGridView then call it a DataGridView. There are other controls named DataGrid and we shouldn't have to guess which one you're using. For that reason, it also helps if you post in the most appropriate form, e.g. if you post in the WPF forum then we know it can't be a DataGridview because it's WinForns only, while posting in WinForms means that it is most likely a DataGridView, although there is an older control also named DataGrid, so naming is still important.

Beyond that, you need to describe what you're actually doing and what actually happens. Unless something is corrupted, fonts don't just change for no reason. If you provide no information then all we can say is that either something is broken, which we can't really help with, or you're doing something wrong, which we can't really help with if you don't tell us what you're doing. Also, you should have already tried to test the same functionality in a separate test project to see whether it behaves the same way. If it doesn't then you know that it is something about your existing project, so you can make changes to the test project to make it more like the existing project to see if it behaves the same way. If it never does then your project is broken somehow, so you should trash it and use a new one, importing as much as you can from the old one as you can without importing the issue too.
 
Top Bottom