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 do not work because i coded it to
change the flatstyles(if needed) to whatever theme the user is using.
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?(if possible by using my image list)
Thank you to whoever can help.