-
June 25th, 2009, 02:10 PM
#1
Creating a label (WinAPI)
I've been looking through the documentation of
CreateWindow and CreateWindowEx and I can't seem to find the style to create a basic label with text.
it's probably in static, but then again i'm not too sure
Help would be appreciated.
-
June 25th, 2009, 03:34 PM
#2
Re: Creating a label (WinAPI)
What is a "basic label with text"?
Victor Nijegorodov
-
June 25th, 2009, 03:57 PM
#3
Re: Creating a label (WinAPI)
it's like a textbox but with not white or boarders.. basically text to tell the user what the place is for.
like the textbeside the fields
-
June 26th, 2009, 01:17 AM
#4
Re: Creating a label (WinAPI)
Originally Posted by james2432
it's probably in static, but then again i'm not too sure
Be sure you need a static common control (of class "static").
Take a look at Static Control Styles.
-
June 26th, 2009, 08:33 AM
#5
Re: Creating a label (WinAPI)
Here is an example where a label is created, with an input field on its right side:
Code:
static HWND hwnd_st_u, hwnd_ed_u;
int x, w, y, h;
y = 10; h = 20;
x = 10; w = 50;
hwnd_st_u = CreateWindow("static", "ST_U",
WS_CHILD | WS_VISIBLE | WS_TABSTOP,
x, y, w, h,
hwnd, (HMENU)(501),
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
SetWindowText(hwnd_st_u, "User:");
x += w; w = 60;
hwnd_ed_u = CreateWindow("edit", "",
WS_CHILD | WS_VISIBLE | WS_TABSTOP
| ES_LEFT | WS_BORDER,
x, y, w, h,
hwnd, (HMENU)(502),
(HINSTANCE) GetWindowLong (hwnd, GWL_HINSTANCE), NULL);
SetWindowText(hwnd_ed_u, "Bill");
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|