Click here to Skip to main content
16,006,378 members
Home / Discussions / C#
   

C#

 
GeneralRe: Backup the registry settings. Pin
Laddie28-Feb-08 22:35
Laddie28-Feb-08 22:35 
GeneralRe: Backup the registry settings. Pin
CodingLover28-Feb-08 22:41
CodingLover28-Feb-08 22:41 
GeneralRe: Backup the registry settings. Pin
buchstaben28-Feb-08 22:49
buchstaben28-Feb-08 22:49 
GeneralRe: Backup the registry settings. Pin
Laddie28-Feb-08 22:55
Laddie28-Feb-08 22:55 
GeneralRe: Backup the registry settings. Pin
CodingLover28-Feb-08 23:20
CodingLover28-Feb-08 23:20 
GeneralFont problem in windows Vista Pin
D i x y28-Feb-08 22:12
D i x y28-Feb-08 22:12 
GeneralRe: Font problem in windows Vista [modified] Pin
DaveyM6929-Feb-08 3:02
professionalDaveyM6929-Feb-08 3:02 
GeneralRe: Font problem in windows Vista Pin
D i x y29-Feb-08 17:31
D i x y29-Feb-08 17:31 
Hello Sir,

I have tried the solution that u gave me but it is not working ....

Before using your solution i was using this one....


class PrivateFonts
{
[DllImport("Gdi32.dll", CharSet = CharSet.Auto, SetLastError = true, ExactSpelling = true)]
private static extern IntPtr AddFontMemResourceEx(IntPtr pbFont, int cbFont, int pdv, ref int pcFonts);
public System.Drawing.Text.PrivateFontCollection GetFont(string[] FontResource)
{
//Get the namespace of the application
string NameSpc = System.Reflection.Assembly.GetExecutingAssembly().GetName().Name.ToString();
System.IO.Stream FntStrm;
System.Drawing.Text.PrivateFontCollection FntNc = new System.Drawing.Text.PrivateFontCollection();
int i;
for (i = 0; i <= FontResource.GetUpperBound(0); i++)
{
//Get the resource stream area where the font is located
FntStrm = System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream(NameSpc + "." + FontResource[i]);
//Load the font off the stream into a byte array
byte[] ByteStrm = new byte[(int)FntStrm.Length + 1];
FntStrm.Read(ByteStrm, 0, Convert.ToInt32((int)FntStrm.Length));
//Allocate some memory on the global heap
IntPtr FntPtr = System.Runtime.InteropServices.Marshal.AllocHGlobal(System.Runtime.InteropServices.Marshal.SizeOf(typeof(byte)) * ByteStrm.Length);
//Copy the byte array holding the font into the allocated memory.
System.Runtime.InteropServices.Marshal.Copy(ByteStrm, 0, FntPtr, ByteStrm.Length);
//Add the font to the PrivateFontCollection
FntNc.AddMemoryFont(FntPtr, ByteStrm.Length);
Int32 pcFonts;
pcFonts = 1;
AddFontMemResourceEx(FntPtr, ByteStrm.Length, 0, ref pcFonts);
//Free the memory
System.Runtime.InteropServices.Marshal.FreeHGlobal(FntPtr);
}
return FntNc;
}
}


<b>ON BUTTON CLICK</b>

//string[] fontNames = { "FRE3OF9X.TTF" };
//PrivateFonts privateFonts = new PrivateFonts();
//System.Drawing.Text.PrivateFontCollection FntNc = privateFonts.GetFont(fontNames);
//labelBarcode.Font = new Font(FntNc.Families[0], 12);


Can you tell me what modification i have to do to get this work on Vista
because its working nice on XP....


Thanks
GeneralRe: Font problem in windows Vista [modified] Pin
DaveyM6929-Feb-08 22:42
professionalDaveyM6929-Feb-08 22:42 
GeneralRe: Font problem in windows Vista Pin
D i x y29-Feb-08 22:51
D i x y29-Feb-08 22:51 
GeneralRe: Font problem in windows Vista Pin
DaveyM6929-Feb-08 23:13
professionalDaveyM6929-Feb-08 23:13 
QuestionDatagrid row color Pin
Arijit Banerjee28-Feb-08 22:03
Arijit Banerjee28-Feb-08 22:03 
GeneralRe: Datagrid row color Pin
Laddie28-Feb-08 22:14
Laddie28-Feb-08 22:14 
QuestionRe: Datagrid row color Pin
Arijit Banerjee2-Mar-08 17:25
Arijit Banerjee2-Mar-08 17:25 
GeneralC# Accessing third Party software Using windows handler Pin
Rehan Anis28-Feb-08 20:46
Rehan Anis28-Feb-08 20:46 
GeneralRe: C# Accessing third Party software Using windows handler Pin
Nouman Bhatti28-Feb-08 21:01
Nouman Bhatti28-Feb-08 21:01 
Questionhow to view a particular value of a combo box? Pin
Saira Tanwir28-Feb-08 20:43
Saira Tanwir28-Feb-08 20:43 
GeneralRe: how to view a particular value of a combo box? Pin
Laddie28-Feb-08 20:46
Laddie28-Feb-08 20:46 
GeneralRe: how to view a particular value of a combo box? Pin
buchstaben28-Feb-08 20:49
buchstaben28-Feb-08 20:49 
QuestionHow apply Single Scrollbar for Treview control in C# Pin
mohindar_kks28-Feb-08 20:30
mohindar_kks28-Feb-08 20:30 
AnswerRe: How apply Single Scrollbar for Treview control in C# Pin
Laddie28-Feb-08 20:37
Laddie28-Feb-08 20:37 
GeneralQuestion about C# OOPS Pin
Vimalsoft(Pty) Ltd28-Feb-08 20:27
professionalVimalsoft(Pty) Ltd28-Feb-08 20:27 
GeneralRe: Question about C# OOPS Pin
Nouman Bhatti28-Feb-08 20:58
Nouman Bhatti28-Feb-08 20:58 
GeneralRe: Question about C# OOPS Pin
Vimalsoft(Pty) Ltd28-Feb-08 23:04
professionalVimalsoft(Pty) Ltd28-Feb-08 23:04 
GeneralRe: Question about C# OOPS Pin
Mark Churchill28-Feb-08 23:35
Mark Churchill28-Feb-08 23:35 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.