This question already has an answer here:
I want to know when the user clicks the menu item he should be able to know the direct X version installed on his machine?
I want to code this in C# in VS2008.
What should i write in the menu item click event? Am a beginner in C#,so dont know where to start from..
can anybody please help? Thanks..
Found this question linked in another but I see the solution is not peffect so I post my idea of how to solve the problem. But beware: it very, very slow.
EDIT: Removed registry check method because it works only for Dx <=9 (thx @Telanor)
This method is very, very slow, but only one I figured out that is 100% accurate
This may help: .NET How to detect if DirectX 10 is supported?.
Edit:
Below is some better code I think. The best I can come up with is a check based on Windows version in the case of DX10 or DX11. This is not 100% accurate (because Vista can be upgraded to DX11 but I do not check for this), but better than nothing.