c# - WPF MessageBox window style -
how apply default windows style standard messagebox
in wpf?
for example, when execute next code:
messagebox.show("hello stack overflow!", "test", messageboxbutton.okcancel, messageboximage.exclamation);
i'm getting message box:
but in winforms ok style:
messagebox.show("hello stack overflow!", "test", messageboxbuttons.okcancel, messageboxicon.exclamation);
according this page, wpf picks old styles of controls.
to rid of it, have create custom app.manifest file (add -> new item -> application manifest file) , paste following code in (right after /trustinfo - tag ):
<!-- activate windows common controls v6 usage (xp , vista): --> <dependency> <dependentassembly> <assemblyidentity type="win32" name="microsoft.windows.common-controls" version="6.0.0.0" processorarchitecture="*" publickeytoken="6595b64144ccf1df" language="*" /> </dependentassembly> </dependency>
then have compile solution app.manifest (set in project properties -> application -> point new manifest in "icons , manifest").
if start application should winforms- messagebox.
Comments
Post a Comment