Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 56381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:31:32+00:00 2026-05-10T17:31:32+00:00

Dialog closes with Cancel result, no exceptions, as if you have pressed its close

  • 0

Dialog closes with Cancel result, no exceptions, as if you have pressed its close button.
The only safe place to set RightToLeft property is in the form constructor.

It occured to me that this information might save somebody else’s time.
If you are able to elaborate on the issue: if there is an official bug confirmation, what else might cause ShowDialog to end unexpectedly, please, do.

Re: close to tray – MSDN Forums

change Form RightToLeft property at runtime


Quote from the second link:

I have found a second bug in less than two days . This new bug is very critical .

I have Normal Form with RightToLeft property set to its default value ( RightToLeft=False) . Let us show this form with Show Function ( Form1.Show(me) )

At this Form there is a Button which change Form RightToLeft to Yes instead of No:

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Me.RightToLeft = Windows.Forms.RightToLeft.Yes
End Sub

The Form will change its Title successfully to Right Side.

Up To This there is no problem.

Problem Occure as following

If we Display this Form to the user using ShowDialog(Me) Function instead of display it using Show(Me) . Then Click Button which will change Form RightToLeft to Yes instead of No , Form will Close Suddenly with no reasons , and even not throw any exceptions .
This is the new problem & it’s exist also in .NET 3.0 ( Orcase ) Too .

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T17:31:32+00:00Added an answer on May 10, 2026 at 5:31 pm

    Ok… I have a quick fix for you. It is nasty, it is a hack but it kinda works.

    From my answer to the original question:

    private bool _rightToLeft; private void SetRTL(bool setRTL) {     _rightToLeft = true;     ApplyRTL(setRTL, this); }  private void ApplyRTL(bool yes, Control startControl) {     if ((startControl is Panel) || (startControl is GroupBox))     {         foreach (Control control in startControl.Controls)         {             control.Location = CalculateRTL(control.Location, startControl.Size, control.Size);         }     }     foreach (Control control in startControl.Controls)         ApplyRTL(yes, control); }  private Point CalculateRTL(Point currentPoint, Size parentSize, Size currentSize) {     return new Point(parentSize.Width - currentSize.Width - currentPoint.X, currentPoint.Y); }  private void Form2_FormClosing(object sender, FormClosingEventArgs e) {     if (_rightToLeft)     {         _rightToLeft = false;         e.Cancel = true;     } } 

    The shneaky part it to attach to the form closing event and then tell it to not close if you have just conducted a right to left swap (_rightToLeft). Having told it not close you remove the right to left flag and let life continue on.

    *bug: there is a bug that occurs when closing a form open with .Show(this), but I am sure you can fix that!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Good morning! I have a user login page /Account/Login.aspx which uses a custom I've
I am trying to create a jQuery function to check whether a Cancel or
I am trying to create a simple dialog box to allow my user to
I have a custom Swing component called NavigationLink which extends JLabel and implements a
I have a program that will get messages from a server and store them
I'm currently trying to learn OO Javascript so I can write some cleaner code.
I am reading one book which says Rather than setting the DialogResult by hand
I'm writing a Windows application that basically runs in the background with a notification
I'm designing a rather long form that will auto-save every couple minutes (i.e., using
In my application I am building a zip file for the User to download

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.