Click here to Skip to main content
15,895,709 members
Home / Discussions / C#
   

C#

 
QuestionHow to register a DLL in Windows Mobile Pin
king'ori21-Jun-10 4:57
king'ori21-Jun-10 4:57 
AnswerRe: How to register a DLL in Windows Mobile Pin
I Believe In GOD21-Jun-10 9:16
I Believe In GOD21-Jun-10 9:16 
Questionftp over ssl Pin
mon***z21-Jun-10 1:50
mon***z21-Jun-10 1:50 
AnswerRe: ftp over ssl Pin
Not Active21-Jun-10 2:29
mentorNot Active21-Jun-10 2:29 
GeneralRe: ftp over ssl Pin
#realJSOP21-Jun-10 2:50
mve#realJSOP21-Jun-10 2:50 
AnswerRe: ftp over ssl Pin
Mirko198021-Jun-10 3:02
Mirko198021-Jun-10 3:02 
GeneralRe: ftp over ssl Pin
ddecoy21-Jun-10 4:26
ddecoy21-Jun-10 4:26 
Questionsending events PrintPageEventArgs and PaintEventArgs Pin
wojsza21-Jun-10 1:43
wojsza21-Jun-10 1:43 
Ive got a question about sending events between functions, i have created a funcion that generates a picture form strings in form and it looks like:

private void generator(object sender, PaintEventArgs e)
       {
           Font czcionka = new Font("Arial", 12);
           SolidBrush pedzel = new SolidBrush(Color.Black);

           Bitmap pic = new Bitmap(Convert.ToInt32(docSzerokosc.Text), Convert.ToInt32(docWysokosc.Text));

           StringFormat format = new StringFormat();
           format.FormatFlags = StringFormatFlags.DirectionRightToLeft;

           string[,] formParm = formularzDane(this);

           if (formParm.Length != 0)
           {
               int iloscParm = formParm.GetLength(0);

               double pt = 28.3464567;

               for (int x = 0; x < iloscParm; x++)
               {
                   string value = formParm[x, 0];
                   float X = (Convert.ToSingle(Convert.ToDouble(formParm[x, 1]) * pt));
                   float Y = (Convert.ToSingle(Convert.ToDouble(formParm[x, 2]) * pt));

                   PointF wspolrzedne = new PointF(X, Y);

                   e.Graphics.DrawString(value, czcionka, pedzel, wspolrzedne, format);
               }
           }
       }


and next this pictuse is supposed to send to print event

private void drukStrone(object sender, PrintPageEventArgs e)
{
    Paint += new PaintEventHandler(this.generator);
}


and finalli it shold be printed using this funcion

public void zatwierdz_dokument_Click(object sender, EventArgs e)
{
    PrintDocument printDoc = new PrintDocument();
    printDoc.PrintPage += this.drukStrone;

    PrintDialog dlgUstawienia = new PrintDialog();
    dlgUstawienia.Document = printDoc;

    try
    {
        printDoc.Print();
    }
    catch (Exception x)
    {
        MessageBox.Show("Błąd: " + x.Message + " " + x.HelpLink, "Wyjątek");
    }
}


But there is aproblem i think drukStrone does not work properly, it works when i copy code from generator to this funcion but it wold be useless having 2 same fucions(generator is generating pic for print preview also), im stuck and need an idea ;o
AnswerRe: sending events PrintPageEventArgs and PaintEventArgs Pin
Luc Pattyn21-Jun-10 2:29
sitebuilderLuc Pattyn21-Jun-10 2:29 
Questionclosed messagabox in c# ??? Pin
aa_zz20-Jun-10 22:57
aa_zz20-Jun-10 22:57 
AnswerMessage Closed Pin
20-Jun-10 23:55
stancrm20-Jun-10 23:55 
GeneralRe: closed messagabox in c# ??? Pin
aa_zz20-Jun-10 23:59
aa_zz20-Jun-10 23:59 
GeneralMessage Closed Pin
21-Jun-10 0:04
stancrm21-Jun-10 0:04 
GeneralRe: closed messagabox in c# ??? Pin
aa_zz21-Jun-10 0:13
aa_zz21-Jun-10 0:13 
AnswerRe: closed messagabox in c# ??? Pin
hammerstein0521-Jun-10 1:13
hammerstein0521-Jun-10 1:13 
QuestionReading Microsoft Project file problem Pin
DJ24520-Jun-10 22:05
DJ24520-Jun-10 22:05 
QuestionGet datatype from dataset and convert it into oledbdatatype Pin
shoubi20-Jun-10 21:25
shoubi20-Jun-10 21:25 
AnswerRe: Get datatype from dataset and convert it into oledbdatatype Pin
Mycroft Holmes20-Jun-10 23:31
professionalMycroft Holmes20-Jun-10 23:31 
QuestionOperation did not succeed because the program cannot commit or quit a cell value change. Pin
jojoba201120-Jun-10 20:19
jojoba201120-Jun-10 20:19 
AnswerRe: Operation did not succeed because the program cannot commit or quit a cell value change. Pin
Peace ON20-Jun-10 23:03
Peace ON20-Jun-10 23:03 
QuestionRe: Operation did not succeed because the program cannot commit or quit a cell value change. Pin
jojoba201120-Jun-10 23:04
jojoba201120-Jun-10 23:04 
Question[WinForms] Zoom in/out UserControl/DesignSurface Pin
akamper20-Jun-10 20:13
akamper20-Jun-10 20:13 
AnswerRe: [WinForms] Zoom in/out UserControl/DesignSurface Pin
freakyit21-Jun-10 5:13
freakyit21-Jun-10 5:13 
GeneralRe: [WinForms] Zoom in/out UserControl/DesignSurface Pin
akamper22-Jun-10 3:37
akamper22-Jun-10 3:37 
Questionleave focus from datagridView Pin
jojoba201120-Jun-10 17:41
jojoba201120-Jun-10 17:41 

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.