Caption Text of Button Not Display

Topics related to the Krypton Toolkit.

Moderators: Phil Wright, Chris Porter

Caption Text of Button Not Display

Postby tushar3g » Mon Apr 26, 2010 5:31 pm

Hi...

Here I use Krypton Toolkit 3.5.2.0 in .Net (2.0) Windows Application.

This will work fine in XP.

But when i try to run my exe on windows 7 64-bit OS then text of button is not display(blank button appeared).

So Please guide me about to solve this problem.

Thanks in Advance.

Regards Tushar
tushar3g
 
Posts: 3
Joined: Mon Apr 26, 2010 5:04 pm

Re: Caption Text of Button Not Display

Postby Edgar Ferreira » Mon Apr 26, 2010 7:04 pm

Windows Vista and 7 have different system fonts and the text rendering is also different.
Some solutions:
1. You need to provide controls with extra top/bottom margins (you can decrease buttons's Margin or increase container's height)
2. You can set a different font size to each krypton button
3. You can set the default font size for each krypton palette - in your constructor, for example - using something like this
Code: Select all
KryptonManager.PaletteOffice2010Blue.BaseFontSize = 7.25f;


NOTE: you need to upgrade Krypton to the last version in order to implement solution 3.
Edgar Ferreira
 
Posts: 132
Joined: Thu Mar 26, 2009 8:59 pm
Location: Coimbra, Portugal

Re: Caption Text of Button Not Display

Postby tushar3g » Tue Apr 27, 2010 12:10 am

hi Edgar

Thanks For quick reply.

but i dont found any property like
"KryptonManager.PaletteOffice2010Blue.BaseFontSize = 7.25f;"

so how to i keep same font in any appearance in any OS theme.

Thanks Edgar...
tushar3g
 
Posts: 3
Joined: Mon Apr 26, 2010 5:04 pm

Re: Caption Text of Button Not Display

Postby Edgar Ferreira » Tue Apr 27, 2010 12:27 am

The problem is that the default font in Vista/7 needs more vertical space and if you have a krypton button with about 23px height, the inner client size won't be enough to fit the text properly (and it will disappear).

As I said, you need to update the krypton Toolkit to the last version if you want to test solution 3.
Or you can try another solution, as I described.
I prefer to change the inner padding of each button, because it will be prepared to fit a wider variety of font sizes:
Code: Select all
kryptonButton.StateCommon.Content.Padding = new Padding(-1, -2, -1, -2);
Edgar Ferreira
 
Posts: 132
Joined: Thu Mar 26, 2009 8:59 pm
Location: Coimbra, Portugal

Re: Caption Text of Button Not Display

Postby tushar3g » Tue Apr 27, 2010 10:47 pm

thanx.
My problem is solved.
tushar3g
 
Posts: 3
Joined: Mon Apr 26, 2010 5:04 pm

Re: Caption Text of Button Not Display

Postby jreategui » Wed Apr 28, 2010 9:31 pm

I Have the same problem but not in differents version of Windows, this occurs on 2 WinXp Computers.
I´m using procexp.exe to evaluate the resources that my application is using. With this, i see that computer 1 and computer 2 are using diferent fonts. Here is some image of this:
Computer 1
PC1.GIF
Fonts using Computer 1
PC1.GIF (3.07 KiB) Viewed 1956 times

Computer 2
pc2.GIF
Fonts using Computer B
pc2.GIF (2.71 KiB) Viewed 1956 times


I think that is the problem, Krypton for some reasons are using different font on different computers.

Exist some way to force Krypton to use a specific font without change the font on each krypton control that i use on my application?


PD: I'm using Krypton toolkit 4.1.6.0
jreategui
 
Posts: 1
Joined: Wed Apr 28, 2010 8:39 pm

Re: Caption Text of Button Not Display

Postby EJocys » Wed Nov 24, 2010 8:55 pm

@Krypton Developers: This issue must be treated as bug of Krypton Toolkit and fixed because System.Windows.Forms.Button have default size of 75,23 and have no issues in XP, Vista or Windows 7 in Visual Studio designer or when running as application. Workarounds like increased button size or manually updated padding is not acceptable because it just creates other problems. Increased size brakes layout look because big buttons don't align perfectly with TextBoxes and manual padding adjustment of all buttons on all forms is just wrong way of developing.
EJocys
 
Posts: 2
Joined: Wed Nov 24, 2010 8:38 pm

Re: Caption Text of Button Not Display

Postby kamisen » Mon Jan 31, 2011 7:26 pm

EJocys wrote:@Krypton Developers: This issue must be treated as bug of Krypton Toolkit and fixed because System.Windows.Forms.Button have default size of 75,23 and have no issues in XP, Vista or Windows 7 in Visual Studio designer or when running as application. Workarounds like increased button size or manually updated padding is not acceptable because it just creates other problems. Increased size brakes layout look because big buttons don't align perfectly with TextBoxes and manual padding adjustment of all buttons on all forms is just wrong way of developing.

Agreed. It's a bug because the default settings of KT does not allow the KButton to 'work' on 7.
Version 4.3.1 does not fix this.
kamisen
 
Posts: 3
Joined: Thu Jul 08, 2010 8:14 pm

Re: Caption Text of Button Not Display

Postby quimbo » Thu Mar 15, 2012 5:19 am

will there be a fix for this other than adjusting the padding?
quimbo
 
Posts: 169
Joined: Sat Sep 08, 2007 3:38 am


Return to Krypton Toolkit

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest