C
Curtis Wellborn
Hey,
I have come into a bit of a problem.
When Flatsyle is on system it will not show my images that i have set in
image list or just in image.
Also somethings i have found online does not work because i coded the
application to change the flatstyles(if needed) to whatever theme the
user is using. I call this at FORM_LOAD.
This is the code that effects it:
private void RecursivelyFormatForWinXP(Control control)
{
for(int x = 0; x < control.Controls.Count; x++)
{
// If the control derives from ButtonBase,
// set its FlatStyle property to FlatStyle.System.
if(control.Controls[x].GetType().BaseType == typeof(ButtonBase))
{
((ButtonBase)control.Controls[x]).FlatStyle = FlatStyle.System;
}
// If the control holds other controls, iterate through them also.
if(control.Controls.Count > 0)
{
RecursivelyFormatForWinXP(control.Controls[x]);
}
}
}
and...
private void frmNonPOReceiptsEntry_Load(object sender,
System.EventArgs e)
{
// Makes sure Windows XP is running and
// a .manifest file exists for the EXE.
if(Environment.OSVersion.Version.Major > 4
& Environment.OSVersion.Version.Minor > 0
& System.IO.File.Exists(Application.ExecutablePath + ".manifest"))
{
// Iterate through the controls.
for(int x = 0; x < this.Controls.Count; x++)
{
// If the control derives from ButtonBase,
// set its FlatStyle property to FlatStyle.System.
if(this.Controls[x].GetType().BaseType == typeof(ButtonBase))
{
((ButtonBase)this.Controls[x]).FlatStyle = FlatStyle.System;
}
RecursivelyFormatForWinXP(this.Controls[x]);
}
}
}
So my question is how do i get my own images to show up on the buttons
after the XP Visual style has been loaded?(if possible by using my image
list)
Thank you to whoever can help.
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
I have come into a bit of a problem.
When Flatsyle is on system it will not show my images that i have set in
image list or just in image.
Also somethings i have found online does not work because i coded the
application to change the flatstyles(if needed) to whatever theme the
user is using. I call this at FORM_LOAD.
This is the code that effects it:
private void RecursivelyFormatForWinXP(Control control)
{
for(int x = 0; x < control.Controls.Count; x++)
{
// If the control derives from ButtonBase,
// set its FlatStyle property to FlatStyle.System.
if(control.Controls[x].GetType().BaseType == typeof(ButtonBase))
{
((ButtonBase)control.Controls[x]).FlatStyle = FlatStyle.System;
}
// If the control holds other controls, iterate through them also.
if(control.Controls.Count > 0)
{
RecursivelyFormatForWinXP(control.Controls[x]);
}
}
}
and...
private void frmNonPOReceiptsEntry_Load(object sender,
System.EventArgs e)
{
// Makes sure Windows XP is running and
// a .manifest file exists for the EXE.
if(Environment.OSVersion.Version.Major > 4
& Environment.OSVersion.Version.Minor > 0
& System.IO.File.Exists(Application.ExecutablePath + ".manifest"))
{
// Iterate through the controls.
for(int x = 0; x < this.Controls.Count; x++)
{
// If the control derives from ButtonBase,
// set its FlatStyle property to FlatStyle.System.
if(this.Controls[x].GetType().BaseType == typeof(ButtonBase))
{
((ButtonBase)this.Controls[x]).FlatStyle = FlatStyle.System;
}
RecursivelyFormatForWinXP(this.Controls[x]);
}
}
}
So my question is how do i get my own images to show up on the buttons
after the XP Visual style has been loaded?(if possible by using my image
list)
Thank you to whoever can help.
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!