Windows 10: Region.GetBounds(Graphics) has different values in local and Remote desktop in c# windows forms

Discus and support Region.GetBounds(Graphics) has different values in local and Remote desktop in c# windows forms in Windows 10 BSOD Crashes and Debugging to solve the problem; Regions.GetBounds(Graphics) is giving different values of Width in physical login and remote desktop login. This issue is observed with Windows 10... Discussion in 'Windows 10 BSOD Crashes and Debugging' started by M V Sreedhar, Sep 11, 2019.

  1. Region.GetBounds(Graphics) has different values in local and Remote desktop in c# windows forms


    • Regions.GetBounds(Graphics) is giving different values of Width in physical login and remote desktop login.
    • This issue is observed with Windows 10

    Region.GetBounds(Graphics) has different values in local and Remote desktop in c# windows forms 581e69f5-c070-43b2-a8f0-827ee0b26579?upload=true.png Region.GetBounds(Graphics) has different values in local and Remote desktop in c# windows forms 13800881-18e0-4969-9fbf-cf03fc447ab1?upload=true.png


    Code snippet used in the sample is below


    private void button1_Click(object sender, EventArgs e)
    {
    using (
    var stringFormat = new StringFormat(StringFormatFlags.MeasureTrailingSpaces))
    {
    string text;
    RectangleF textRectangle;
    Region[] regions;
    using (
    Graphics graphics = textBox1.CreateGraphics())
    {
    text = textBox1.
    Text;
    Font font = textBox1.Font;

    textRectangle =
    new RectangleF(0, 0, int.MaxValue, int.MaxValue);

    CharacterRange[] characterRanges = { new CharacterRange(0, text.Length) };

    stringFormat.
    SetMeasurableCharacterRanges(characterRanges);

    regions = graphics.
    MeasureCharacterRanges(text, font, textRectangle, stringFormat);

    textRectangle = regions[0].GetBounds(graphics);
    }

    foreach (Region region in regions)
    {
    region.
    Dispose();
    }

    richTextBox1.
    Clear();

    richTextBox1.
    AppendText($"Text : {text}" + Environment.NewLine + "RectangleF Properties:"+ Environment.NewLine);
    richTextBox1.
    AppendText($"RectangleF.X : {textRectangle.X}" + Environment.NewLine);
    richTextBox1.
    AppendText($"RectangleF.Y : {textRectangle.Y}" + Environment.NewLine);
    richTextBox1.
    AppendText($"RectangleF.Height : {textRectangle.Height}" + Environment.NewLine);
    richTextBox1.
    AppendText($"RectangleF.Width : {textRectangle.Width}" + Environment.NewLine);
    richTextBox1.
    AppendText($"RectangleF.Right : {textRectangle.Right}" + Environment.NewLine);

    }
    }


    :)
     
    M V Sreedhar, Sep 11, 2019
    #1

  2. Remote Desktop

    Okay guys need some help here before going crazy...
    I am trying to setup a remote desktop connection and see exactly what the logged on user is looking at with out going through Windows Remote Desktop.

    Since its local network I don't have any password or want to setup a password.

    Any suggestions are appreciated
     
    kikicoco1334, Sep 11, 2019
    #2
  3. Windows 10 - Remote Desktop

    Hi,

    We will surely assist you with the issue you are facing with Windows 10.
    - Which version of Windows 10 Operating System are you using?

    - Were you able to upgrade to Windows 10 successfully?

    I suggest you to refer the below steps and see if this helps.


    • Enable remote desktop in settings
      • Control Panel\System and Security\System, Click "Remote Settings" on the left side

    • Verify my port forwarding settings were properly forwarding to my computers local IP address
      • run "cmd.exe" and then type "ipconfig". Find your IP from that list
    [*]
    • Make sure your firewall settings are open
    • Go to "Control Panel\System and Security\Windows Firewall\Allowed apps"
    • On the left, click "Allow an app or feature through Windows Firewall"
    • Click "Change Settings"
    • Find "Remote Desktop" in the list and make sure both "Private" and "Public" is checked.

    Let us know if this helps.

    Thank you.

    Credits to : Jace_Sango.
     
    Akheel Ahmed, Sep 11, 2019
    #3
  4. Region.GetBounds(Graphics) has different values in local and Remote desktop in c# windows forms

    remote desktop connection

    You will need to analyse the various stages that form part of the remote desktop connection. This will require some time and patience.

    A remote desktop connection consists of these components:

    • A host (which must run Windows Professional). This is the machine that you wish to control.
    • A client (which can run any version of Windows). This is the machine that you work on.
    • A link that connects the client with the host.
    Is the host on the same network as the client or is it on a different network?
     
    Frederik Long, Sep 11, 2019
    #4
Thema:

Region.GetBounds(Graphics) has different values in local and Remote desktop in c# windows forms

Loading...
  1. Region.GetBounds(Graphics) has different values in local and Remote desktop in c# windows forms - Similar Threads - Region GetBounds Graphics

  2. Deleted lot of files form local disk c

    in Windows 10 Gaming
    Deleted lot of files form local disk c: Hello. After searching I found that I had deleted a lot of system files. And i really need help. I dont know what should i do : As you can see I dont even have settings, i deleted bunch of important things :/ Pls teach me step by step if not i probably wont understand...
  3. Deleted lot of files form local disk c

    in Windows 10 Software and Apps
    Deleted lot of files form local disk c: Hello. After searching I found that I had deleted a lot of system files. And i really need help. I dont know what should i do : As you can see I dont even have settings, i deleted bunch of important things :/ Pls teach me step by step if not i probably wont understand...
  4. Remote desktop works local network but not remote.

    in Windows 10 Gaming
    Remote desktop works local network but not remote.: I want to set this up with TailScale and not port forwarding. I use NORD VPNTeamViewer and AnyViewer works just fin d remotely https://answers.microsoft.com/en-us/windows/forum/all/remote-desktop-works-local-network-but-not-remote/560d84a2-3117-42b1-baea-a72eb3e5e2f2
  5. Remote desktop works local network but not remote.

    in Windows 10 Software and Apps
    Remote desktop works local network but not remote.: I want to set this up with TailScale and not port forwarding. I use NORD VPNTeamViewer and AnyViewer works just fin d remotely https://answers.microsoft.com/en-us/windows/forum/all/remote-desktop-works-local-network-but-not-remote/560d84a2-3117-42b1-baea-a72eb3e5e2f2
  6. Remote Desktop to different port

    in Windows 10 Gaming
    Remote Desktop to different port: I have used remote desktop with a ssh tunnel to log into remote machines over the internet. This was accomplished by pointing to localhost:someport. Windows 11 RDP complains that I can't specify a port : is illegal. Is there a way around this???Thanks...
  7. Remote Desktop to different port

    in Windows 10 Software and Apps
    Remote Desktop to different port: I have used remote desktop with a ssh tunnel to log into remote machines over the internet. This was accomplished by pointing to localhost:someport. Windows 11 RDP complains that I can't specify a port : is illegal. Is there a way around this???Thanks...
  8. Remote Desktop Corrupted Graphics

    in Windows 10 Customization
    Remote Desktop Corrupted Graphics: I have remote desktop set up on my Windows 10 10.0.19041 desktop. When trying to access the computer from my OSX 11.0.1 laptop using Remote Desktop Client Version 10.5.0 and and/or my iPhone iOS 14.2 using Client Version 10.1.3 4119 the connection is established fine, but the...
  9. RectangleF.Width has different values in local and Remote desktop in c# windows forms

    in Windows 10 BSOD Crashes and Debugging
    RectangleF.Width has different values in local and Remote desktop in c# windows forms: RectangleF.Width is giving different values in physical login and remote desktop login. This issue is observed with Windows 10 [ATTACH][ATTACH] Code snippet used in the sample is below private void button1_Click(object sender, EventArgs e) { using (var...
  10. Local and Regional.

    in Windows 10 Customization
    Local and Regional.: I am located in Norway, but use windows in English US. I get Windows store, One Note, Groove, Weather, Photo and Film/TV apps in Norwegian Language. Have changed my country or region from Norway to USA to avoide this mixup, but it still does not work. Which additional...