C# manually create window like java's JFrame, JPanel / Canvas & Graphics -
C# manually create window like java's JFrame, JPanel / Canvas & Graphics -
i've worked java , creating rpg game, created window game using jframe. how can in visual studio in c# using code , not design editor in java eclipse? more how can create window using c# in microsoft visual studio using java in eclipse? want because want manually draw images , each pixel of window , able create fullscreen on specific screen can changed in-game.
because seeking analog jframe, presume "full screen" mean "maximized."
you can command on rendering of windows form overriding onpaint() method. careful calculations relative dimensions of form. also, since shirking ide , wysiwyg editor, beware become hard alter course of study later if decide want utilize design tools create toolbars, buttons, etc. might create more sense instead create form wysiwyg editor , place panel onto form, create custom drawing routine on panel. in event, based on question understand it, here minimal code:
using system; using system.drawing; using system.windows.forms; namespace windowsformsapplication2 { static class programme { /// <summary> /// main entry point application. /// </summary> [stathread] static void main() { application.enablevisualstyles(); application.setcompatibletextrenderingdefault(false); application.run(new myform()); } } public class myform : form { public myform() { //initializecomponent(); } protected override void onpaint(painteventargs e) { base.onpaint(e); graphics gfx = e.graphics; gfx.drawrectangle(pens.black, 10f, 10f, 10f, 10f); } } }
c#
Comments
Post a Comment