PDA

Click to See Complete Forum and Search --> : Scroll Bars in an Edit box...


Dec 16th, 2000, 01:02 PM
This is in a header file I am writing to make it easier to create buttons and other controls(with the Windows API)


#include <windows.h>


HWND CreateButton(HINSTANCE hInstance, HWND parent, char * text, int x, int y, int cx, int cy)
{
HWND hwndb;
hwndb = CreateWindowEx(0, "BUTTON", text, WS_CHILD, x, y, cx, cy, parent, NULL, hInstance, NULL);
return hwndb;
}

HWND CreateEdit(HINSTANCE hInstance, HWND parent, char * text, int x, int y, int cx, int cy)
{
HWND hwnde;
hwnde = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", text, WS_CHILD + ES_MULTILINE, x, y, cx, cy, parent, NULL, hInstance, NULL);
return hwnde;
}


both functions work,
but I don't know which style to use to make the text box have a verticle and horizontal scrollbar...

I can't seem to find it in the platform SDK...



Thanks,

Dennis

Dec 17th, 2000, 08:14 AM
Come on... can't somebody help me??



Thanks,
Dennis

Dec 17th, 2000, 01:02 PM
Ok, Somebody helped me figure it out...
incase you are wondering... here is my code


#include <windows.h>
#include <string>

using namespace std;


HWND MCreateEdit(HINSTANCE hInstance, HWND parent, string text, int x, int y, int cx, int cy, bool multiline)
{

long styles = 0;
HWND hwnde;
if (multiline == true)
{
styles = ES_MULTILINE | WS_HSCROLL | WS_VSCROLL;
}
hwnde = CreateWindowEx(WS_EX_CLIENTEDGE, "EDIT", text.c_str(), WS_CHILD | WS_VISIBLE | styles, x, y, cx, cy, parent, NULL, hInstance, NULL);
return hwnde;
}




Dennis