Hi Again David,
The dObj may have to be the parent of the controls. Which means what is the
group under?
So the oGroup I have below will have to be assigned:
Set oGroup = dObj.Parent( name)
Meaning look at your dialog and set that variable to the father of the
collection so it knows where to look, which may be the mainDialog.Control( name)
Set oGroup = mainDialog.Control( groupName)
I suspect this is what you want besides what I gave below.
Bruce
Sent: Tuesday, January 28, 2014 8:07 AM
Subject: Re: Changing the Group Text on the fly, for a dialog
Hi David,
As Chip had given an example to, try setting a temp var in the event to
at least get a control object before testing anything then delete it when
exiting.
But you may look at the Clip object as well.
Dim oPerson, oGroup:
Set oPerson = DObj.Control( "Checkbox_Personal" )
Set oGroup = DObj.Control( "Group_SaveInfo" )
If Not oPerson Is Nothing and oGroup Is Nothing Then
If oPerson.checked Then oBroup.Text = "Personal"
End If
Set oPerson = Nothing
Set oGroup = Nothing
Now, this may be a clip and has to be under a clip, not an individual
item and have not looked up the parm on it, but suspect this might be the case.
Bruce
' Code Snip-it:
If DObj.Control( "Checkbox_Personal" ).Checked Then
DObj.Control( "Group_SaveInfo" ).Text = "Personal" ' This line
gives an
error, that the DObj.Control is not valid.
Sent: Monday, January 27, 2014 3:32 AM
Subject: Changing the Group Text on the fly, for a dialog
Hey guys,
I have a Dialog, with several Groups defined and setup in the XML file. All
that is great, and I have entered an individual ID for each Group. So, for
instance, I will have the following Group IDs:
Group_RetrieveInfo
Group_SaveInfo
Group_ExitingControls
Ok, what I want to do, is to change the Text property of one of the Groups
- dynamically within my code. That is, based on some other activity and the
state of some of the controls in the dialog, I want - let's say - the Text
property of Group_SaveInfo to change. At one point, it could be set to
"Personal", and at another case, it could be set to "Publicly".
I have tried the following inside my EventHandler function, but keep
getting an error. Guess, because the Group is not part of the Control
collection. But then, what is the correct syntax, please?
' Code Snip-it:
If DObj.Control( "Checkbox_Personal" ).Checked Then
DObj.Control( "Group_SaveInfo" ).Text = "Personal" ' This line
gives an error, that the DObj.Control is not valid.
Else
DObj.Control( "Group_SaveInfo" ).Text = "General Public"
End If
' Snip-it concludes.
Thanks for any corrections you may have for the above.
Regards,
David
------------------------------------------------------------------------------
This email is free from viruses and malware because avast! Antivirus
protection is active.
---
This email is free from viruses and malware because avast! Antivirus protection
is active.
http://www.avast.com