|
-
Dec 6th, 2017, 07:50 PM
#1
Re: DGV Column header
I just selected the ColumnHeadersDefaultCellStyle property in the Properties window and pressed F1 to open context-sensitive Help. It opened the MSDN documentation to the page for that property and that page contained this:
If visual styles are enabled and EnableHeadersVisualStyles is set to true, all header cells except the TopLeftHeaderCell are painted using the current theme and the ColumnHeadersDefaultCellStyle values are ignored.
I went back to the designer and set the EnableHeadersVisualStyles property to False and, sure enough, I saw in my grid exactly what you apparently expect. All up, it took me about two minutes. At the risk of being accused of making snide remarks, this is how easy it can be to solve your own issues if you just use the Help system built into VS. I've been advocating doing so on this site for well over a decade; since back when I was a newbie with VB and was answering questions on topics I had no experience with simply by using the Help menu in VS. Feel free to think I'm an arrogant ass if you want but please do yourself a favour and use the VS Help system first when you need help.
By the way, I set all those properties in the designer and I'd suggest that you do the same. I tend to recommend setting all properties in the designer that can be and only using code if the values will change after loading or the values won't be known until loading.
-
Dec 6th, 2017, 08:33 PM
#2
Thread Starter
Fanatic Member
Re: DGV Column header
Wow. It always turns out that the more I learn the less I know.
All snide aside, I did indeed peruse the Help system and was unable to find the information that would provide the answer for this issue. Probably due to the fact that I had no prior knowledge of many of the capabilities residing in VB. On the other hand, I have sometimes been able to consult the help and find exactly what I am looking for.
It is a crap shoot and I am sure that even professionals such as yourself are not always able to find the information that fits the situation you are in. Certainly I did not, this time.
I do believe you to be an arrogant ass JM, as I have previously stated, but not in this case. I always consult with the Help System prior to asking a question here. Sometimes I am able to find what I am looking for and sometimes I do not.
You are probably right about setting every property one can in the designer and not stick them in the code unless absolutely required (I think that is what you meant). Another case of being bitten on the ass because I was doing more than I really needed to do and changing things that really did not require changing.
Thanks
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|