This is a migrated thread and some comments may be shown as answers.

Can't disable risize form at Radribbon form

5 Answers 449 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Johnny
Top achievements
Rank 2
Johnny asked on 30 Dec 2010, 06:08 AM
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

5 Answers, 1 is accepted

Sort by
0
Accepted
Richard Slade
Top achievements
Rank 2
answered on 30 Dec 2010, 10:25 AM
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

0
Richard Slade
Top achievements
Rank 2
answered on 31 Dec 2010, 10:46 AM
Hello,

did this help? If so please remember to mark as answer
thanks
Richard
0
Johnny
Top achievements
Rank 2
answered on 02 Jan 2011, 05:39 PM
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
0
Richard Slade
Top achievements
Rank 2
answered on 03 Jan 2011, 11:54 AM
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
0
Ivan Todorov
Telerik team
answered on 03 Jan 2011, 05:04 PM
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.
Tags
RibbonBar
Asked by
Johnny
Top achievements
Rank 2
Answers by
Richard Slade
Top achievements
Rank 2
Johnny
Top achievements
Rank 2
Ivan Todorov
Telerik team
Share this question
or