i need to set some text at a specific location on one of my controls. how do i set a simple label? i must admit i havent researched much on labels. thought it might save me some time when i get back from work. thanks smurf
Posted on 2001-06-04 20:46:00 by smurf
You need to use TextOut in your WM_PAINT handler (Be sure to use Begin & EndPaint as well). Icz tute #5 shows this. If you want default windows font, get it with GetStockObject. Other fonts can be retrieved by calling CreateFont with the default value for all arguments except the font name. (You have to SelectObject, hDC, hFont to activate the font)
Posted on 2001-06-05 02:54:00 by Qweerdy
if you just want a simple label create a static control with CreateWindowEx. see in the mshelp for the static styles (search for CreateWindow). ensein
Posted on 2001-06-05 05:45:00 by ensein
thanks Qweerdy for the reply. for some reason i couldnt stop the text i created using your method to stop repainting itself and it was using 100% of my cpu for it. ensign thanks a bunch. the static window method is much simpler to use and is actually designed for this purpose. thanks i was able to implement into my program in a few minutes. :) smurf
Posted on 2001-06-05 06:08:00 by smurf