PC Review


Reply
 
 
Eric Seneca
Guest
Posts: n/a
 
      5th Jun 2005
Hello,

I am trying to draw a series of panels on a graphic object. I am new to
drawing object programmically and was wondering if anyone knew of a good
tutorial that would show me how to control the objects on the screen.
Any guidance would be appreciated...

Eric
 
Reply With Quote
 
 
 
 
Tim Wilson
Guest
Posts: n/a
 
      5th Jun 2005
Are you referring to actual painting using a Graphics object or dynamically
creating controls, such as the Panel control, and adding them to a
container?

If your inquiring about custom painting then see if this helps clear some
things up.
http://www.awprofessional.com/articl...&seqNum=2&rl=1

--
Tim Wilson
..Net Compact Framework MVP

"Eric Seneca" <(E-Mail Removed)> wrote in message
news:N0Foe.61736$(E-Mail Removed)...
> Hello,
>
> I am trying to draw a series of panels on a graphic object. I am new to
> drawing object programmically and was wondering if anyone knew of a good
> tutorial that would show me how to control the objects on the screen.
> Any guidance would be appreciated...
>
> Eric



 
Reply With Quote
 
Eric Seneca
Guest
Posts: n/a
 
      5th Jun 2005
Tim Wilson wrote:
> Are you referring to actual painting using a Graphics object or dynamically
> creating controls, such as the Panel control, and adding them to a
> container?
>
> If your inquiring about custom painting then see if this helps clear some
> things up.
> http://www.awprofessional.com/articl...&seqNum=2&rl=1
>

i am trying to actually create the control and not paint things on the
screen. Say create a panel inside a picturebox on a form...

Eric Seneca
 
Reply With Quote
 
Tim Wilson
Guest
Posts: n/a
 
      5th Jun 2005
So you're looking to create a control and add it to another control as a
child? If you look at the InitializeComponent method that is controlled by
the designer you can see how controls are created and added as children to
other controls. Although I don't believe that the PictureBox is an allowable
container. In other words, if you attempt to add a control to the Controls
collection of a PictureBox I believe you will be met with an exception.

--
Tim Wilson
..Net Compact Framework MVP

"Eric Seneca" <(E-Mail Removed)> wrote in message
news:ffFoe.61808$(E-Mail Removed)...
> Tim Wilson wrote:
> > Are you referring to actual painting using a Graphics object or

dynamically
> > creating controls, such as the Panel control, and adding them to a
> > container?
> >
> > If your inquiring about custom painting then see if this helps clear

some
> > things up.
> >

http://www.awprofessional.com/articl...&seqNum=2&rl=1
> >

> i am trying to actually create the control and not paint things on the
> screen. Say create a panel inside a picturebox on a form...
>
> Eric Seneca



 
Reply With Quote
 
Eric Seneca
Guest
Posts: n/a
 
      5th Jun 2005
Tim Wilson wrote:
> So you're looking to create a control and add it to another control as a
> child? If you look at the InitializeComponent method that is controlled by
> the designer you can see how controls are created and added as children to
> other controls. Although I don't believe that the PictureBox is an allowable
> container. In other words, if you attempt to add a control to the Controls
> collection of a PictureBox I believe you will be met with an exception.
>

humm i see what you are saying to get aroudn this i set a picture box
and create panels dynamically via code and set the parent of that code
to the actualy form the picture boxe is on. The i bring the panel to the
front with a color and i have it in the contain frmMain...

Thanks..
 
Reply With Quote
 
Tim Wilson
Guest
Posts: n/a
 
      5th Jun 2005
That's one way to do it, yes. Another way would be to use a Panel instead of
a PictureBox and, since I assume that you were setting an image to be
displayed through the PictureBox, painting the image yourself through the
Panels Paint event. Then you could add the child Panels to the Panel that is
custom painted. This way if you ever needed to move the parent Panel then
you know that the child Panels will automatically follow and you won't be
required to move them as well, as will be case if you parent these Panels to
the Form.

--
Tim Wilson
..Net Compact Framework MVP

"Eric Seneca" <(E-Mail Removed)> wrote in message
newsCFoe.62011$(E-Mail Removed)...
> Tim Wilson wrote:
> > So you're looking to create a control and add it to another control as a
> > child? If you look at the InitializeComponent method that is controlled

by
> > the designer you can see how controls are created and added as children

to
> > other controls. Although I don't believe that the PictureBox is an

allowable
> > container. In other words, if you attempt to add a control to the

Controls
> > collection of a PictureBox I believe you will be met with an exception.
> >

> humm i see what you are saying to get aroudn this i set a picture box
> and create panels dynamically via code and set the parent of that code
> to the actualy form the picture boxe is on. The i bring the panel to the
> front with a color and i have it in the contain frmMain...
>
> Thanks..



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
To draw line across panel controls. chittorian Microsoft C# .NET 0 21st Oct 2008 01:55 PM
How to draw line on Panel? =?Utf-8?B?U2FudG9zaA==?= Microsoft Dot NET Compact Framework 1 13th Jul 2006 11:19 AM
Draw a Line in a Panel Control? Roger Odermatt Microsoft Dot NET Compact Framework 1 19th Jan 2006 12:34 PM
Draw Bitmap on Panel - How to? Graeme Anderson Microsoft Dot NET Compact Framework 1 7th May 2004 12:21 PM
Draw grid on panel? JustMe Microsoft Dot NET Compact Framework 2 11th Nov 2003 08:52 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:12 PM.