1) Could you tell me the best way to do timer, updated i.e. every 1 sec (display i.e. in editbox)?

2) How to draw grid on the form (like in ResEdit etc.)?

Thanks 4 help!
Posted on 2004-04-19 15:01:29 by Deli
Posted on 2004-04-19 19:41:37 by iblis
Creating a Grid is mostly just two loops calling Drawline :)

Figure this:

invoke GetClientRect,hWnd,o$ rect
xor ebx,ebx
invoke SelectObject,hDC,hGreyPen
.WHILE ebx <= rect.bottom
add ebx,10
invoke MoveToEx,hDC,0,ebx,0
invoke LineTo,hDC,rect.right, ebx
xor ebx, ebx
.WHILE ebx <= rect.right
add ebx,10
invoke MoveToEx,hDC,ebx,0,0
invoke LineTo,hDC,ebx,rect.right

Dump this code inside WM_PAINT but before that create a Brush (for hGreyBrush) and call BeginPaint (to get the hDC) - and EndPaint afterwards. Read up in Iczelions Tut Nr 4 ( http://spiff.tripnet.se/~iczelion/tut4.html ) on how to do that.

Note that this code will create flicker. To eliminate flicker you need to research BackBuffers. Thomas ( www.madwizard.org ) has an excellent Mosaic Tutorial which guides you through all this. (Actually he even creates a grid there to)

Hope this helps.
Posted on 2004-04-19 22:04:34 by JimmyClif