如何在vc ++ win32中创建可滚动的MDIClient控件 [英] how to create a scrollable MDIClient control in vc++ win32

查看:87
本文介绍了如何在vc ++ win32中创建可滚动的MDIClient控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以告诉如何让MDIclient在visual studio c ++中可滚动,我的意思是我有一个程序并且它上面有一个MDIClient控件窗口所以我想要的是我需要在那个子窗口上插入一些项目说一些按钮和文本框等,所以我想让窗口滚动。我可以创建滚动条和窗口,但我无法将它们连接在一起向我展示我需要的所有东西。这是我创建MDIClient的代码。

代码:

can anyone tell how to make MDIclient to be scrollable in visual studio c++, I mean I have a program and there is an MDIClient control window on it so what I want is that I need to insert some item on that child window says some buttons and text box and etc, so i wanted to make the window to be scroll able. I could create the scroll bar and the window alright but I cannot connect them together to show me all the stuff I need. here is the code how I create MDIClient.
code :

HWND ChildWindowCreation(HWND hWnd, HINSTANCE hInst){
	hwndClient = CreateWindow (TEXT ("MDICLIENT"), NULL, WS_CHILD |
			                  WS_CLIPCHILDREN | WS_VISIBLE, 0, 0,  
                              0, 0, hWnd, (HMENU) 1, hInst,
                              (PSTR)&clientcreate) ;

	MyRegisterClass(hInst);

	if(!hwndClient){
		MessageBox(NULL, "Program did not made the stuff ready for you", "Error", MB_OK|MB_ICONERROR);
	}

	return hwndClient;
}

以下是我创建滚动条的代码:

代码: -

and here is the code how I create scroll bar:
code:-

hwndClient = CreateWindow (TEXT ("scrollbar"), NULL, WS_CHILD |
			                  WS_VISIBLE, 0, 0,  
                              0, 0, hWnd, (HMENU) 1, hInst,
                              NULL) ;



感谢


thanks

推荐答案

使用WS_VSCROLL和WS_HSCROLL样式创建一个MDI客户端窗口,该窗口分别允许垂直或水平条形MDI子窗口。

Use WS_VSCROLL and WS_HSCROLL styles to create an MDI client window that allows respectively vertical or horizontal bars in the MDI child windows.
hwndClient = CreateWindow (TEXT ("MDICLIENT"), NULL,
                               WS_CHILD | WS_CLIPCHILDREN | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL,
                               0, 0, 0,  0, hWnd, (HMENU) 1, hInst,
                               (PSTR)&clientcreate) ;


这篇关于如何在vc ++ win32中创建可滚动的MDIClient控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆