简体   繁体   中英

c++ create text fits edit box

Well.. I know that title is not that clear, I couldn't think of better one.
I wanna know how to do this...
when you have edit box and it only can show 10 characters.
Something like this


ssssssssss


let just say i have more than 10 characters. Some of them will go in the back.
Like we have this string "123456789010" it will show just these ones "3456789010".
My problem is that some characters are small and don't take that much space and some do.
So i can't find a way to break the string and get some characters in the back.
any idea?

edit box样式类型中尝试使用ES_MULTILINE来使用多行。

edit1=CreateWindowA("edit","edit box",WS_CHILD|WS_VISIBLE|WS_BORDER|ES_MULTILINE,120,160,200,200,hWnd,(HMENU)IDI_EDIT,hInstance,0);

you only want to see the far left or far right?

here is your string "0123456789"

you can only display 5 values due to pixel size of box....

do you want it to be "...56789" more like "56789"

or "01234..." more like "01234"?

您可以计算控件中字符串的显示长度(有多个功能),并相应地调整控件的大小。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM