Click here to Skip to main content
15,919,434 members
Home / Discussions / C#
   

C#

 
AnswerRe: how to get index valus using .net with c# Pin
Christian Graus17-Mar-08 0:23
protectorChristian Graus17-Mar-08 0:23 
GeneralApplication Version Pin
stancrm16-Mar-08 23:20
stancrm16-Mar-08 23:20 
GeneralRe: Application Version Pin
Christian Graus16-Mar-08 23:41
protectorChristian Graus16-Mar-08 23:41 
GeneralSystem.ArgumentException: Parameter is not valid. Pin
D i x y16-Mar-08 23:03
D i x y16-Mar-08 23:03 
GeneralRe: System.ArgumentException: Parameter is not valid. Pin
Christian Graus16-Mar-08 23:09
protectorChristian Graus16-Mar-08 23:09 
GeneralRe: System.ArgumentException: Parameter is not valid. Pin
D i x y16-Mar-08 23:18
D i x y16-Mar-08 23:18 
GeneralRe: System.ArgumentException: Parameter is not valid. Pin
Christian Graus16-Mar-08 23:31
protectorChristian Graus16-Mar-08 23:31 
GeneralRe: System.ArgumentException: Parameter is not valid. Pin
D i x y16-Mar-08 23:44
D i x y16-Mar-08 23:44 
Hello Sir,
All this thing happen when i use some other options of my application like changing color opening help file...


This is the font used to add fonts to my application

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

GeneralRe: System.ArgumentException: Parameter is not valid. Pin
Christian Graus17-Mar-08 0:02
protectorChristian Graus17-Mar-08 0:02 
GeneralRe: System.ArgumentException: Parameter is not valid. Pin
D i x y17-Mar-08 0:04
D i x y17-Mar-08 0:04 
GeneralRe: System.ArgumentException: Parameter is not valid. Pin
Christian Graus17-Mar-08 0:21
protectorChristian Graus17-Mar-08 0:21 
GeneralRe: System.ArgumentException: Parameter is not valid. Pin
D i x y17-Mar-08 0:29
D i x y17-Mar-08 0:29 
GeneralRe: System.ArgumentException: Parameter is not valid. Pin
D i x y17-Mar-08 0:44
D i x y17-Mar-08 0:44 
GeneralRe: System.ArgumentException: Parameter is not valid. Pin
Christian Graus17-Mar-08 1:02
protectorChristian Graus17-Mar-08 1:02 
GeneralRe: System.ArgumentException: Parameter is not valid. Pin
D i x y17-Mar-08 1:06
D i x y17-Mar-08 1:06 
GeneralRe: System.ArgumentException: Parameter is not valid. Pin
D i x y17-Mar-08 18:36
D i x y17-Mar-08 18:36 
Generalproblem in showing the form Pin
Miss Maheshwari16-Mar-08 22:39
Miss Maheshwari16-Mar-08 22:39 
GeneralRe: problem in showing the form Pin
Gareth H16-Mar-08 23:43
Gareth H16-Mar-08 23:43 
GeneralRe: problem in showing the form Pin
Miss Maheshwari16-Mar-08 23:57
Miss Maheshwari16-Mar-08 23:57 
GeneralLink error 2019 and 2028 Pin
ptr2void16-Mar-08 22:12
ptr2void16-Mar-08 22:12 
GeneralRe: Link error 2019 and 2028 Pin
Christian Graus16-Mar-08 22:18
protectorChristian Graus16-Mar-08 22:18 
GeneralRe: Link error 2019 and 2028 Pin
ptr2void16-Mar-08 22:21
ptr2void16-Mar-08 22:21 
GeneralRe: Link error 2019 and 2028 Pin
Christian Graus16-Mar-08 22:22
protectorChristian Graus16-Mar-08 22:22 
GeneralRe: Link error 2019 and 2028 Pin
ptr2void16-Mar-08 22:35
ptr2void16-Mar-08 22:35 
GeneralDate Difference Method Pin
M Riaz Bashir16-Mar-08 22:03
M Riaz Bashir16-Mar-08 22:03 

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.