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:

enter image description here

but in winforms ok style:

messagebox.show("hello stack overflow!", "test", messageboxbuttons.okcancel,      messageboxicon.exclamation); 

enter image description here

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

Popular posts from this blog

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -