How to access GradientFormHeader properties?


Author
Message
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
When you create a new instance of a form which has a GradientFormHeader I have found no way to access the GradientFormHeader properties like Title and DetailText pretty much like we can do with a BrowserDialog.HeaderTitle, I would like to be able to do this:

Dim f As New ReportViewerDialog()

f.rptViewer.HeaderTitle = "My nice header title"

f.rptViewer.DetailText = "My nice detail text sample"

Can this be done now, or will this fall into an Enhancement Request?

Thanks!

Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
What I've done is just expose those properties via public properties of the form:



Public Property Title As String

  Get

    Return Me.GradientHeader1.Title

  End Get

  Set(value As String)

    Me.GradientHeader1.Title = value

  End Set

End Property




The other option would be to make the gradient header public, using the Modifier property:







Then you could use code like:



MyForm.GradientHeader1.Title = "My Title"




I don't see any way for SF to know how you'd compose your forms to automatically provide this sort of functionality though. Fortunately it's not hard to get working though! BigGrin
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Thanks Greg,

That is exactly what I needed, they both work fine.  I choose to create the custom properties since that will make more sense to set at the form level like f.Title instead of f.GradientFormHeader.Title.

Edhy Rijo

Greg McGuffey
Greg McGuffey
Strategic Support Team Member (3.3K reputation)
Group: Forum Members
Posts: 2K, Visits: 6.6K
Glad it worked. My preference in a situation like this would be the custom properties too....but I like choice BigGrin
Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
This will work, but I might suggest creating properties to expose the title, etc. instead of just exposing the object.  Technically this violates encapsulation and if you were to rename the gradient form header, all of your programs would break.  But if you had a property on your base form called Title, or HeaderImage, then it would only be a matter of changing this in the base form versus every program in your app that has referenced this object.  Just a thought and recommendation.
Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Thank you Trent, got it!

Edhy Rijo

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search