c# - Force WaitCursor to the parent form of a modal form -
i have form displays loading animation while backgroundworker doing work, , closes when work complete. show following code:
using (backgroundworker bw = new backgroundworker()) using (loadingpopup loadingpopup = new loadingpopup(bw)) { bw.dowork += delegate { domywork(); }; loadingpopup.showdialog(this); }
my loadingpopup form starts background worker in onshown, , when background worker finishes closes itself.
i want have waitcursor displayed if user hovers on part of parent form or child form.
i've tried adding code loadingpopup onshown event set parent.cursor, owner.cursor, this.cursor, , cursor.current waitcursor, setting them cursor.default in onclosed event. when hover on parent form default cursor.
any way force cursor or set application-wide cursor?
edit: have tried inserting change cursor before , after showdialog line of code in parent. still did not work. prefer loadingpopup manage cursor anyway reusability.
i tried setting usewaitcursor property true on both child form , parent form , had same result.
have tried:
mouse.overridecursor = cursors.wait;
Comments
Post a Comment