c# - clicking messagebox.show() hides showdialog() window -
i have following code in wpf:
private void btnticketprice_click(object sender, routedeventargs e) { ticketprice tp = new ticketprice(); tp.showdialog(); }
in new window form have following code:
private void btnsave_click(object sender, routedeventargs e) { messagebox.show("sometext"); }
on clicking messagebox button form (ticketprice
) closing; how show messagebox without closing form?
if i'd change tp.showdialog();
tp.show();
, works correctly. have problem tp.showdialog();
xaml of button
<button x:name="btnsave" horizontalalignment="left" margin="619,362,0,0" verticalalignment="top" width="165" height="66" iscancel="true" tabindex="4" click="btnsave_click"> <stackpanel orientation="horizontal"> <textblock text="save " horizontalalignment="center" verticalalignment="center" fontweight="semibold" /> <image source="pack://siteoforigin:,,,/resources/save.png" height="50" width="59" /> </stackpanel> </button>
you're seeing iscancel
property on button
working advertised. don't set true
, clicking button won't automatically close dialog.
Comments
Post a Comment