GroupBox Caption Name

If several controls are in a group box and a checkbox within the group box is checked what is the best way to get the caption name of that group box?

You have to cast the Parent of the checkbox to be a groupbox. So, in an event of the checkbox:

dim caption as string
if me.Parent IsA Groupbox then
   caption = GroupBox(me.Parent).Caption
end

[quote=497838:@Tim Hare]You have to cast the Parent of the checkbox to be a groupbox. So, in an event of the checkbox:

dim caption as string if me.Parent IsA Groupbox then caption = GroupBox(me.Parent).Caption end [/quote]
Thanks Tim, that is looking more familiar all the time. Me.Parent was the key.

Looked easy enough but problems. The problem seems to be that the checkbox is not recognizing the group box it’s in as a parent. I do have the checkbox subclassed and your code is in the supers event handler. I wouldn’t think that would be the problem though.
Ideas?

[quote=497839:@Clifford Coulter]Looked easy enough but problems. The problem seems to be that the checkbox is not recognizing the group box it’s in as a parent. I do have the checkbox subclassed and your code is in the supers event handler. I wouldn’t think that would be the problem though.
Ideas?
This answers my question

[/quote]

Looked easy enough but problems. The problem seems to be that the checkbox is not recognizing the group box it’s in as a parent. I do have the checkbox subclassed and your code is in the supers event handler. I wouldn’t think that would be the problem though.
Ideas?
This answers my question

[quote=497845:@Clifford Coulter]Looked easy enough but problems. The problem seems to be that the checkbox is not recognizing the group box it’s in as a parent. I do have the checkbox subclassed and your code is in the supers event handler. I wouldn’t think that would be the problem though.
Ideas?
This answers my question[/quote]
Okay, I just needed to better understand how parenting works and how to change the relationships. I believe I have it now.