Alex
Wed Jul 20 00:55:36 CDT 2005
Not on mine. Why don't you try debugging it, see if you get inside pb_Paint
at all?
--
Alex Feinman
---
Visit
http://www.opennetcf.org
"Robert W." <RobertW@discussions.microsoft.com> wrote in message
news:32282168-301B-4979-8592-08DBB4CF3050@microsoft.com...
> Alex,
>
> Great improvements to the original sample. But I have to share something
> with you: Try dropping a control like a button on the form and then rerun
> it.
> On my system - Pocket PC 2003 Emulator and Dell Axim X30 Pocket PC - the
> presence of any control seems to deactivate your code.
>
> Is there perhaps some special way one needs to add a control when using
> such
> code?
>
> --
> Robert W.
> Vancouver, BC
> www.mwtech.com
>
>
>
> "Alex Feinman [MVP]" wrote:
>
>> I've updated the sample
>>
>> --
>> Alex Feinman
>> ---
>> Visit
http://www.opennetcf.org
>> "Robert W." <RobertW@discussions.microsoft.com> wrote in message
>> news:8725101C-8723-45EC-BCFC-91622E93E81C@microsoft.com...
>> > Alex,
>> >
>> > Thanks! Quite a bit of code to do the same thing one can do so easily
>> > in
>> > a
>> > WinForms app.
>> >
>> > No commenting per say but I tried switching around some parameters to
>> > get
>> > the gradient to go from the top to the bottom rather than left to right
>> > but
>> > wasn't successful. Any suggestions how I could accomplish this?
>> >
>> > --
>> > Robert W.
>> > Vancouver, BC
>> > www.mwtech.com
>> >
>> >
>> >
>> > "Alex Feinman [MVP]" wrote:
>> >
>> >>
http://www.alexfeinman.com/download.asp?doc=GradientFill.zip
>> >>
>> >> --
>> >> Alex Feinman
>> >> ---
>> >> Visit
http://www.opennetcf.org
>> >> "Robert W." <RobertW@discussions.microsoft.com> wrote in message
>> >> news:3FE1E6DB-8E4A-434C-8C0C-2918712F1B65@microsoft.com...
>> >> > The following code draws a linear gradient on my desktop
>> >> > application,
>> >> > but
>> >> > I'd
>> >> > like to learn how to do the same thing on a Pocket PC:
>> >> >
>> >> > /// <summary>
>> >> > /// If you'd like to have linear gradients for the background of
>> >> > your
>> >> > MDI application then do the following:
>> >> > /// 1. Copy the following 3 methods into your parent form.
>> >> > /// 2. Call 'InitialzieLinearGradients()' from your parent
>> >> > form's
>> >> > constructor.
>> >> > /// </summary>
>> >> > public void InitializeLinearGradients()
>> >> > {
>> >> > foreach (Control c in this.Controls)
>> >> > {
>> >> > if (c.GetType().Name == "MdiClient")
>> >> > {
>> >> > c.Paint += new
>> >> > System.Windows.Forms.PaintEventHandler(PaintClientBG);
>> >> > c.SizeChanged += new System.EventHandler(SizeClientBG);
>> >> > }
>> >> > }
>> >> > }
>> >> >
>> >> > protected void SizeClientBG(Object sender, EventArgs e)
>> >> > {
>> >> > sender = sender as MdiClient;
>> >> > this.Invalidate();
>> >> > }
>> >> >
>> >> > protected void PaintClientBG(Object sender, PaintEventArgs e)
>> >> > {
>> >> > MdiClient mc = sender as MdiClient;
>> >> > e.Graphics.Clip = new Region(mc.ClientRectangle);
>> >> >
>> >> > LinearGradientBrush lgb = new
>> >> > LinearGradientBrush(mc.ClientRectangle,
>> >> > Color.LightBlue, Color.Navy, 90F, false);
>> >> > e.Graphics.FillRectangle(lgb, mc.ClientRectangle);
>> >> > lgb.Dispose();
>> >> > }
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > Robert W.
>> >> > Vancouver, BC
>> >> > www.mwtech.com
>> >> >
>> >>
>> >>
>>
>>