Can't disable risize form at Radribbon form

6 posts, 1 answers
  1. Johnny
    Johnny avatar
    86 posts
    Member since:
    Dec 2010

    Posted 30 Dec 2010 Link to this post

    Hi! I had add the new form to my project which the new form is RadRibbon Form
    At the form i had add the Office2007BlackTheme also.

    I had a question here:
    When run the RadRibbon Form i will able to resize the Form by mouse.
    How do i disable that function.

    I'm Using the RadControls for WinForms Q2 2010 SP2

    Thank!

    Regards
    Johnny
  2. Answer
    Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 30 Dec 2010 Link to this post

    Hello Johnny,

    For any form, you can stop resizing in the following ways:
    Me.FormBorderStyle = Windows.Forms.FormBorderStyle.FixedSingle
    Me.MaximizeBox = False
    Me.MinimizeBox = False

    Hope that helps
    Richard

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 31 Dec 2010 Link to this post

    Hello,

    did this help? If so please remember to mark as answer
    thanks
    Richard
  5. Johnny
    Johnny avatar
    86 posts
    Member since:
    Dec 2010

    Posted 02 Jan 2011 Link to this post

    Hi! Richard,
    Sorry to reply late, my country was on public holiday.
    Happy New Year!

    The solution you give me didn't help to solve the problem.
    I had try to put the code in Form_load and also in Form.Designer.vb
    I still able to resize the form by using the mouse.

    and i found other problem. How can i had my setfocus on RadText and RadButton?
    If using VS.net control. the text and button i just need to put the code like below:

    text1.focus() or button1.focus()

    I try to use on RadText and Radbutton but it can't work.

    Hope you can solve my problem as soon as possible.

    Im doing some POC on all the normal control of Telerik Control behavior
    If there is no problem my company will buy it.

    Thank!

    Regards
    Johnny
  6. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 03 Jan 2011 Link to this post

    Hi Johnny,  -happy new year

    setting focus to a button should give focus as you have described. I am unable though to replicate any of your issues. Please can you post a small sample here using the Format Code block above to demonstrate the issue that you are experiencing and I will do my best to help.
    Can you also confirm that you are trying the latest version (Q3 2010 SP1) of the controls?

    thanks
    Richard
  7. Ivan Todorov
    Admin
    Ivan Todorov avatar
    688 posts

    Posted 03 Jan 2011 Link to this post

    Hello Johnny,

    Thank you for contacting us.

    RadRibbonForm inherits the WinForms Form class so most of the things that apply to the generic Form apply to the RadRibbonForm as well.

    You can set the MinimumSize and MaximumSize properties to be equal to the Size property. Doing so the user wont be able to resize or maximize the form.

    this.Size = new Size(320, 240);
    this.MinimumSize = new Size(320, 240);
    this.MaximumSize = new Size(320, 240);

    Another approach is to override the WndProc method and handle the WM_SIZING message:

    public partial class RibbonForm : RadRibbonForm
    {
         
        public RibbonForm()
        {
            InitializeComponent();
            this.Size = new Size(320, 240);
        }
     
        const int WM_SIZING = 0x214;
     
        struct RECT
        {
            public int left;
            public int top;
            public int right;
            public int bottom;
        }
     
        protected override void WndProc(ref Message m)
        {
            if (m.Msg == WM_SIZING)
            {
                RECT rc = (RECT)System.Runtime.InteropServices.Marshal.PtrToStructure(m.LParam, typeof(RECT));
     
                rc.bottom = rc.top + 240;
                rc.right = rc.left + 320;
     
                System.Runtime.InteropServices.Marshal.StructureToPtr(rc, m.LParam, true);
            }
            base.WndProc(ref m);
        }
    }

    Hope this will help you. Feel free to ask if you have any further questions.

    Kind regards,
    Ivan Todorov
    the Telerik team
    Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
Back to Top
UI for WinForms is Visual Studio 2017 Ready