c# - Updating string in a picture box -
this question has answer here:
- how draw object in picturebox c#? 1 answer
- how draw lines delay? 5 answers
i want create little game. therefore need help, because last time used graphics-library 10 years ago.
what plan do: have picturebox , grapics object
graphics g; void mainthread() { thread.sleep(500); g.fillrectangle(mybrushes.white, 0, 0, pbimage.width, pbimage.height); graphics gblank = g; while (shown) { g = gblank; g.drawstring(string.format("x: {0}\ny: {1}", mousechords.x, mousechords.y), new font("arial", 10.0f), mybrushes.black, 755,560); thread.sleep(50); } } public frmmain() { g = pbimage.creategraphics(); thrmain = new thread(new threadstart(mainthread)); }
i'd update cursorposition in down right corner, i'm moving mouse on control looks this.
Comments
Post a Comment