How to create a Panel control with win api ?
How to create a Panel control with win api ?
Hi all,
I am trying to create a panel control, but i cant find any help related to it from web. How to create a panel control with CreateWindowex ?
I am trying to create a panel control, but i cant find any help related to it from web. How to create a panel control with CreateWindowex ?
-
- Posts: 4310
- Joined: Jan 02, 2017 0:34
- Location: UK
- Contact:
Re: How to create a Panel control with win api ?
37 views and no response. I wonder if folks don't know what you mean by 'Panel control' - I don't.
Do you mean invoking the Control Panel programmatically?
Do you mean invoking the Control Panel programmatically?
-
- Posts: 564
- Joined: Sep 27, 2016 18:20
- Location: Valencia, Spain
Re: How to create a Panel control with win api ?
A Panel control is a control that allows grouping of other controls.
You can't create a Panel control with CreateWindowEx for the simple reason that Windows doesn't natively provide one. The closest one is a GroupBox control, although it has not scroll bars.
You can't create a Panel control with CreateWindowEx for the simple reason that Windows doesn't natively provide one. The closest one is a GroupBox control, although it has not scroll bars.
-
- Posts: 4310
- Joined: Jan 02, 2017 0:34
- Location: UK
- Contact:
Re: How to create a Panel control with win api ?
Blimey, I didn't know what a GroupBox control was either. It turns out to be known as a Frame as well and I have been using Frames for years. <laugh>
Actually, I will have to increase my medication. I used a GroupBox in Encrypternet.bas and called it IDC_FRAME1.
I have just spotted a remark at the head of one of José's programs.
' Remarks: In PowerBASIC it is mistakenly called "Frame" instead of "Group Box".
We live and learn - although with some of us it takes a while. <smile>
Actually, I will have to increase my medication. I used a GroupBox in Encrypternet.bas and called it IDC_FRAME1.
Code: Select all
pWindow.AddControl( "GroupBox", , IDC_FRAME1, "Drag && Drop Or Left Click To browse", 24, 16, 286, 100 )
' Remarks: In PowerBASIC it is mistakenly called "Frame" instead of "Group Box".
We live and learn - although with some of us it takes a while. <smile>
-
- Posts: 564
- Joined: Sep 27, 2016 18:20
- Location: Valencia, Spain
Re: How to create a Panel control with win api ?
In the beginning it was called a group box, then came the Visual Basic guys and called it a frame control, and now the .NET guys call it a panel control. It's never too late to create confusion.
However, the panel control has some differences with a groupbox or frame control, among them it has no caption and has scrollbars.
In the beginning, a frame (aka framewindow) control was a static (aka label) control with a WS_GROUP and SS_BLACKFRAME, SS_WHITEFRAME or SS_GRAYFRAME styles. A group box, was a button with the WS_GROUP and BS_GROUPBOX styles.
Frame is also used, e.g. in Java, to designate a main window. In HTML defines one particular window (frame) within a "frameset"...
However, the panel control has some differences with a groupbox or frame control, among them it has no caption and has scrollbars.
In the beginning, a frame (aka framewindow) control was a static (aka label) control with a WS_GROUP and SS_BLACKFRAME, SS_WHITEFRAME or SS_GRAYFRAME styles. A group box, was a button with the WS_GROUP and BS_GROUPBOX styles.
Frame is also used, e.g. in Java, to designate a main window. In HTML defines one particular window (frame) within a "frameset"...
-
- Posts: 1002
- Joined: Jul 14, 2005 23:41
Re: How to create a Panel control with win api ?
A "panel" in the context that I think is being considered by the OP is best replicated by creating a normal borderless window and set its style to WS_CHILD. For example, that's how I simulate the various pages of a Tab Control. You can create child controls on this child window and the show/hide them all at once by simply showing/hiding the window itself.
Re: How to create a Panel control with win api ?
The Panel Control is documented here. It is over 15 years old, accessible only via .NOT methods, and nobody uses it. To the point that Google refuses to honour an image search for windows "panel control" - despite the quotes, you get only images for Control Panel. Anybody noticed that Google gets more and more useless with its conviction that it knows better than you what you want?
As some mentioned earlier, a Group Box does maybe the same or better job, given that it has a caption. Scrollbars? You can add one, and move the child controls accordingly.
As some mentioned earlier, a Group Box does maybe the same or better job, given that it has a caption. Scrollbars? You can add one, and move the child controls accordingly.
-
- Posts: 862
- Joined: May 05, 2015 5:35
- Location: Germany
Re: How to create a Panel control with win api ?
And I thought that it was only a delusion of mine...jj2007 wrote:Anybody noticed that Google gets more and more useless with its conviction that it knows better than you what you want?
Re: How to create a Panel control with win api ?
Ha ha.. Jose said it. That's a container control.deltarho[1859] wrote:37 views and no response. I wonder if folks don't know what you mean by 'Panel control' - I don't.
Do you mean invoking the Control Panel programmatically?
Re: How to create a Panel control with win api ?
Thank you all for the answers.
Let me try. First of all, i am going to read the web page which jj2007 suggested.
By the way, @PaulSquires, I have tried with these styles-
But didnt worked.
Do i need to use a "#32770" class name ? I am confused.
Let me try. First of all, i am going to read the web page which jj2007 suggested.
By the way, @PaulSquires, I have tried with these styles-
Code: Select all
const PNL_STYLE : DWORD = WS_CHILD or WS_VISIBLE or WS_CLIPCHILDREN or WS_CLIPSIBLINGS
const PNL_EX_STYLE : DWORD = WS_EX_CONTROLPARENT or WS_EX_WINDOWEDGE or WS_EX_TRANSPARENT
But didnt worked.
Do i need to use a "#32770" class name ? I am confused.
Re: How to create a Panel control with win api ?
The link is refererring to an ASP.NET panel, which is something completely different and has absolutely nothing to do with Win32 API (but rather with javascript/html). What you probably meant was a WinForms Panel, and it is used a lot. It does not match a native win32 control directly, but you can find the implementation here: https://referencesource.microsoft.com/# ... 0cc724caadjj2007 wrote:The Panel Control is documented here. It is over 15 years old, accessible only via .NOT methods, and nobody uses it.
Re: How to create a Panel control with win api ?
@St_W,
Thanks, THat helped. And you are right. That link says nothing about creating a panel with win32.
BTW, Now, i am able to create a panel in my window. Next hurdle is to change the back color of that panel.
Thanks, THat helped. And you are right. That link says nothing about creating a panel with win32.
BTW, Now, i am able to create a panel in my window. Next hurdle is to change the back color of that panel.