Click here to Skip to main content
15,912,400 members
Home / Discussions / WPF
   

WPF

 
AnswerRe: setting image in nested menu Pin
Pete O'Hanlon6-Oct-15 4:30
mvePete O'Hanlon6-Oct-15 4:30 
GeneralRe: setting image in nested menu Pin
HailStorm26-Oct-15 19:26
HailStorm26-Oct-15 19:26 
GeneralRe: setting image in nested menu Pin
Pete O'Hanlon6-Oct-15 21:01
mvePete O'Hanlon6-Oct-15 21:01 
AnswerRe: setting image in nested menu Pin
Richard Deeming6-Oct-15 5:16
mveRichard Deeming6-Oct-15 5:16 
QuestionAvalon 2.0 with MVVM and 2 anchorable panes Pin
marc borgers1-Oct-15 7:10
marc borgers1-Oct-15 7:10 
QuestionNeed Some Help With This Design Pin
Kevin Marois22-Sep-15 5:42
professionalKevin Marois22-Sep-15 5:42 
SuggestionRe: Need Some Help With This Design Pin
Richard Deeming22-Sep-15 6:10
mveRichard Deeming22-Sep-15 6:10 
GeneralRe: Need Some Help With This Design Pin
Kevin Marois22-Sep-15 6:32
professionalKevin Marois22-Sep-15 6:32 
QuestionStopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs22-Sep-15 0:43
Saurabh18cs22-Sep-15 0:43 
AnswerRe: Stopping resizing of usercontrol and grid cell visibility Pin
Gerry Schmitz23-Sep-15 8:21
mveGerry Schmitz23-Sep-15 8:21 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs23-Sep-15 16:28
Saurabh18cs23-Sep-15 16:28 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Gerry Schmitz24-Sep-15 6:56
mveGerry Schmitz24-Sep-15 6:56 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Saurabh18cs24-Sep-15 21:47
Saurabh18cs24-Sep-15 21:47 
GeneralRe: Stopping resizing of usercontrol and grid cell visibility Pin
Gerry Schmitz24-Sep-15 22:54
mveGerry Schmitz24-Sep-15 22:54 
SuggestionRe: Stopping resizing of usercontrol and grid cell visibility Pin
J. Calhoun24-Sep-15 7:45
J. Calhoun24-Sep-15 7:45 
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 

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.