Click here to Skip to main content
15,888,270 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs24-Sep-15 21:50
Saurabh18cs24-Sep-15 21:50 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
J. Calhoun25-Sep-15 2:14
J. Calhoun25-Sep-15 2:14 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs25-Sep-15 20:06
Saurabh18cs25-Sep-15 20:06 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
J. Calhoun28-Sep-15 3:06
J. Calhoun28-Sep-15 3:06 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs29-Sep-15 0:13
Saurabh18cs29-Sep-15 0:13 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
J. Calhoun29-Sep-15 3:38
J. Calhoun29-Sep-15 3:38 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs29-Sep-15 17:28
Saurabh18cs29-Sep-15 17:28 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
J. Calhoun30-Sep-15 3:11
J. Calhoun30-Sep-15 3:11 
First thing I noticed is the commented line:
C#
//m_windowUI.MaximumSize = new System.Drawing.Size(305, 500);
This will only set the maximum size of the element host so that you can not size it any larger than this size. The same rule will apply to MinimumSize, it will not size any smaller than that size.

C#
m_windowUI.Size = new System.Drawing.Size(305,500);
is the event that I believe you are looking for. It has been a while since I worked with windows forms, but I believe when you set the size of a control it will not resize when the window does.

I suppose you could set a minimum and maximum that are the same size, but the real thing to understand here is that both the user control and the element host inherit from Control, so they should both be thought of as controls inside a window.

Now, that being said you can find a good reference of all of the properties of your element host here:
https://msdn.microsoft.com/en-us/library/vstudio/system.windows.forms.integration.elementhost%28v=vs.100%29.aspx[^]
And could possibly fix the client area of the control to a certain size, that way the UserControl would only fit inside that area?

Again it has been a while since I worked with Windows.Forms, but I will create a little dummy project and see if I can't find a solution, but hopefully these suggestions might get you on the right track.

If you could help me get a visual of what I need to recreate... Windows.Forms Window, element host, then WPF UserControl. The UserControl is in the element host that is docked inside a window with other winforms controls? or is the usercontrol hosted by itself inside the window?
I can't remember what I forgot...

GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs30-Sep-15 22:45
Saurabh18cs30-Sep-15 22:45 
QuestionWPF UI Loading Question Pin
Kevin Marois11-Sep-15 5:50
professionalKevin Marois11-Sep-15 5:50 
AnswerRe: WPF UI Loading Question Pin
Kenneth Haugland12-Sep-15 1:57
mvaKenneth Haugland12-Sep-15 1:57 
AnswerRe: WPF UI Loading Question Pin
Pete O'Hanlon12-Sep-15 11:36
mvePete O'Hanlon12-Sep-15 11:36 
GeneralRe: WPF UI Loading Question Pin
Kevin Marois14-Sep-15 15:27
professionalKevin Marois14-Sep-15 15:27 
GeneralRe: WPF UI Loading Question Pin
Dave Kreskowiak15-Sep-15 3:25
mveDave Kreskowiak15-Sep-15 3:25 
QuestionVerticalAlignment.Bottom Problem Pin
Kevin Marois11-Sep-15 5:36
professionalKevin Marois11-Sep-15 5:36 
AnswerRe: VerticalAlignment.Bottom Problem Pin
Kenneth Haugland20-Sep-15 22:07
mvaKenneth Haugland20-Sep-15 22:07 
SuggestionRe: VerticalAlignment.Bottom Problem Pin
J. Calhoun24-Sep-15 9:22
J. Calhoun24-Sep-15 9:22 
QuestionWPF How To Freeze The UI Pin
Kevin Marois10-Sep-15 5:57
professionalKevin Marois10-Sep-15 5:57 
QuestionSearchTextBox by sean a. hanley Pin
Saurabh18cs9-Sep-15 16:22
Saurabh18cs9-Sep-15 16:22 
SuggestionRe: SearchTextBox by sean a. hanley Pin
Richard MacCutchan9-Sep-15 22:16
mveRichard MacCutchan9-Sep-15 22:16 
AnswerRe: SearchTextBox by sean a. hanley Pin
Pete O'Hanlon9-Sep-15 23:02
mvePete O'Hanlon9-Sep-15 23:02 
QuestionExtract audio from a video and process it Pin
Member 119602474-Sep-15 7:41
Member 119602474-Sep-15 7:41 
AnswerRe: Extract audio from a video and process it Pin
Richard MacCutchan4-Sep-15 21:37
mveRichard MacCutchan4-Sep-15 21:37 
GeneralRe: Extract audio from a video and process it Pin
Member 119602478-Sep-15 6:05
Member 119602478-Sep-15 6:05 
GeneralRe: Extract audio from a video and process it Pin
Richard MacCutchan8-Sep-15 6:08
mveRichard MacCutchan8-Sep-15 6:08 

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.