CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2009
    Posts
    18

    [RESOLVED] Terminal Service Control Resizing

    I have a win form with a terminal service control on it so my program connects via RDP.
    Using MSTSCLib.
    When I change the form size I can't get the terminal service control to resize to the form.

    I have set dock to fill and anchor to left, right, top, bottom with no luck. I have set both in properties and even created the resize event and set the controls in there on resize but the terminal service control stays the original size.
    Code:
    connRDP.Anchor = (AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right);
    connRDP.Dock = DockStyle.Fill;
    Invalidate();
    I have even tried setting the control to the form size but again no luck
    Code:
    connRDP.Height = this.Size.Height;
    connRDP.Width = this.Size.Width;
    Invalidate();
    Is there some special way I need to tell the Terminal Service Control to resize to the form?

    Thanks in advance
    Last edited by Omegadarkest; May 19th, 2011 at 11:28 PM.

  2. #2
    Join Date
    May 2011
    Location
    Washington State
    Posts
    220

    Re: Terminal Service Control Resizing

    I just added a terminal service control to a plain form, set dock to 'fill', ran the program, and it seemed to work just fine.

    Check the control for other properties that may be throwing you... "Locked", Remove the anchors, shouldn't need if dock = fill... The control has a "Full Screen" setting... what do you have that at? I don't know the effect of it, but I didn't use it, something to look at...

    Do you have the term svc control directly on the form, or in another container control?

    (1 caveat to my test... i'm not actually connecting to anything either, just testing dock and resize with parent...)

  3. #3
    Join Date
    Dec 2009
    Posts
    18

    Re: Terminal Service Control Resizing

    Sorry I should have check this to begin with but I am still missing something

    The control itself is actually resizing to the form but the size of the connected RDP window stays at the original size of the control.

    I don't want it to actually "full screen" like the actual rdp app does, just to resize it self to the current size of the control I assume now.

    *EDIT*
    If I set the form to max and dock to fill, then shrink the form it resizes down. When I max the form it sizes back up.
    The main form I assume becomes locked, even though it is set to sizable I can't resize it by dragging.
    It will only switch between Max and size of the actual form as created in the ide.

    *EDIT2*
    I am actually going with the above as it works and using it in max window 90% of the time anyways.
    Last edited by Omegadarkest; May 24th, 2011 at 04:36 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured