For Programmers: Free Programming Magazines  


Home > Archive > C# > January 2006 > Windows Media Control Resizing









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Windows Media Control Resizing
sudeeprgaitonde@gmail.com

2005-12-13, 4:13 am

Hello,

I have a Windows Media Control (of fixed size, say 300 X 200) placed on

an User Control. This user control is then used in a Windows Form.

Now what I want is that this Windows Media Control should prevent the
outer Form from resizing below its own size of 300 X 200 (when the Form

is being resized to say 299 length and/or 199 width or something less).


Thanks in advance.

Sudeep

Ciaran

2006-01-10, 4:09 am

Put this in the constructor. I think it should work but dont have tools to
test with me:

Control parent = this.Parent;
while (parent != null && !(parent is Form)){
parent = parent.Parent;
}
Form myparentform = parent as Form;
if (myparentform != null){
myparentform.MinimumSize = new Size(300,200);
}

This is keeping moving one level up the control tree from your control till
it is at the top or it finds a form (which might be the top). If it found a
form, it sets teh minimum size for the form.


--

Ciaran O'Donnell
There are 10 types of people in this world. Those that understand binary and
those that don't


<sudeeprgaitonde@gmail.com> wrote in message
news:1134457805.928442.147320@g14g2000cwa.googlegroups.com...
> Hello,
>
> I have a Windows Media Control (of fixed size, say 300 X 200) placed on
>
> an User Control. This user control is then used in a Windows Form.
>
> Now what I want is that this Windows Media Control should prevent the
> outer Form from resizing below its own size of 300 X 200 (when the Form
>
> is being resized to say 299 length and/or 199 width or something less).
>
>
> Thanks in advance.
>
> Sudeep
>



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com