c# - WPF full transparent + non clickable -
okay guys, have problem wpf application. far managed create window transparent background ( + no brush ). added function, if window focused. window should never been focused (because of transparency). working, when add together lets rectangle (on canvas):
rectangle testrectanglefortext = new rectangle(); testrectanglefortext.stroke = brushes.black; testrectanglefortext.strokethickness = 5; testrectanglefortext.fill = null; testrectanglefortext.height = 300; testrectanglefortext.width = 300; canvas.setleft(testrectanglefortext, 0); canvas.settop(testrectanglefortext, 20); mycanvas.children.add(testrectanglefortext);
the rectangle clickable , if click on it, app focused (applicationfocus function display messagebox) , don't want that. found solution win forms, not wpf, thats why i'm asking here. solution win forms here: winform solution
okay illustration i'm trying achieve: example image
so reddish zone window (wpf app) size. background transparent (obviously). background application notepad. can see text , rectangle on canvas. now, if click on 1.(first) arrow, btw transparent area, nil happens (thats good). if click on 2.(second) arrow, messagebox appear, means wpf app focused , dont want.
try set focusable
attribute in xaml-code:
<window ... focusable="false"> < ... /> </window>
c# wpf transparency clickable
No comments:
Post a Comment