# Problem with Border Thickness of DesktopRectangle

**URL:** <https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104>\
**Category:** Windows\
**Created:** [October 29, 2026, 7:46am UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104 "2026-10-29T07:46:49Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![Boris\_Klusmeyer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/dfb087/32.png) [@Boris\_Klusmeyer](https://forum.xojo.com/u/Boris_Klusmeyer)\
**Post date:** [October 29, 2026, 7:46am UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/1 "2026-10-29T07:46:49Z")

</div>

Hello,

I’m currently using Xojo mainly to create Windows programmes and am in the process of replacing some of my work-related database-driven [VB.NET](http://VB.NET) programmes with it (switching from Access to SQLite). As well as Xojo’s simplicity, it also suits us that we can create a macOS version for each programme, as we’re seeing more and more Mac laptops in our classes.

Unfortunately, I do get the impression that the Windows compiler is being somewhat neglected.

At the moment, I’m working on a problem with the Windows DesktopRectangle. I use this to group controls (no, the GroupBox is not an alternative!).

Unfortunately, the ‘Border’ property appears to be faulty. When I specify a border of 1 or 2 pixels, it appears differently on each of the four sides of the box.  
I’ve also tried to solve this using a custom control with the DesktopCanvas. Unfortunately, the DesktopCanvas is very slow in the Paint method.  
Does anyone have a solution to this problem?

Cheers

Boris

---

<div class="post-metadata">

**Author:** ![Thomas\_Kaltschmidt](https://forum.xojo.com/letter_avatar_proxy/v4/letter/t/f0a364/32.png) [@Thomas\_Kaltschmidt](https://forum.xojo.com/u/Thomas_Kaltschmidt)\
**Post date:** [October 29, 2026, 7:54am UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/2 "2026-10-29T07:54:53Z")

</div>

Hi Boris, do you have a little sample project showing the issue? And the canvas-paint should not be slow - far from it.

best, Thomas

---

<div class="post-metadata">

**Author:** ![RudolfJ](https://forum.xojo.com/user_avatar/forum.xojo.com/rudolfj/32/644_2.png) [@RudolfJ](https://forum.xojo.com/u/RudolfJ)\
**Post date:** [October 29, 2026, 8:08am UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/3 "2026-10-29T08:08:49Z")

</div>

long-standing issue between fill and draw for rounded rectangles

// DesktopCanvas CornerSize problem - OK

var mypen as double = 20  
g.DrawingColor = color.green  
g.FillRoundRectangle(0,0,canvas1.Width,canvas1.height,80,80)  
g.PenSize = mypen  
g.DrawingColor = color.black  
g.drawRoundRectangle(0,0,canvas1.Width,canvas1.height,80-mypen,80-mypen)

---

<div class="post-metadata">

**Author:** ![Boris\_Klusmeyer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/dfb087/32.png) [@Boris\_Klusmeyer](https://forum.xojo.com/u/Boris_Klusmeyer)\
**Post date:** [October 29, 2026, 8:29am UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/4 "2026-10-29T08:29:23Z")

</div>

This is a sample of the DesktopRectangle

 ![Xojo](https://forum.xojo.com/uploads/default/original/3X/1/0/10224a776a323ac9f9c1ae858ac122995bcff184.png)

---

<div class="post-metadata">

**Author:** ![Boris\_Klusmeyer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/dfb087/32.png) [@Boris\_Klusmeyer](https://forum.xojo.com/u/Boris_Klusmeyer)\
**Post date:** [October 29, 2026, 8:34am UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/5 "2026-10-29T08:34:16Z")

</div>

I just tried it.

The frame appear onle when the windows is fully loaded.

---

<div class="post-metadata">

**Author:** ![Ian\_Kennedy](https://forum.xojo.com/user_avatar/forum.xojo.com/ian_kennedy/32/6860_2.png) [@Ian\_Kennedy](https://forum.xojo.com/u/Ian_Kennedy)\
**Post date:** [October 29, 2026, 9:14am UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/6 "2026-10-29T09:14:34Z")

</div>

That looks like a 3D depth effect?

---

<div class="post-metadata">

**Author:** ![Boris\_Klusmeyer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/dfb087/32.png) [@Boris\_Klusmeyer](https://forum.xojo.com/u/Boris_Klusmeyer)\
**Post date:** [October 29, 2026, 9:19am UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/7 "2026-10-29T09:19:10Z")

</div>

Yes, but can I disable that?

---

<div class="post-metadata">

**Author:** ![Ian\_Kennedy](https://forum.xojo.com/user_avatar/forum.xojo.com/ian_kennedy/32/6860_2.png) [@Ian\_Kennedy](https://forum.xojo.com/u/Ian_Kennedy)\
**Post date:** [October 29, 2026, 10:46am UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/8 "2026-10-29T10:46:47Z")

</div>

Can you show your drawing code?

---

<div class="post-metadata">

**Author:** ![Boris\_Klusmeyer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/dfb087/32.png) [@Boris\_Klusmeyer](https://forum.xojo.com/u/Boris_Klusmeyer)\
**Post date:** [October 29, 2026, 11:01am UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/9 "2026-10-29T11:01:48Z")

</div>

I use for the test the Code **[RudolfJ](https://forum.xojo.com/u/rudolfj)** published above.

---

<div class="post-metadata">

**Author:** ![Ian\_Kennedy](https://forum.xojo.com/user_avatar/forum.xojo.com/ian_kennedy/32/6860_2.png) [@Ian\_Kennedy](https://forum.xojo.com/u/Ian_Kennedy)\
**Post date:** [October 29, 2026, 11:05am UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/10 "2026-10-29T11:05:00Z")

</div>

Have you reported it as a bug. Provide steps to reproduce and a small example that shows the problem.

[https://tracker.xojo.com/xojoinc/xojo/-/work\_items?sort=popularity&state=opened&first\_page\_size=20](https://tracker.xojo.com/xojoinc/xojo/-/work_items?sort=popularity&state=opened&first_page_size=20)

---

<div class="post-metadata">

**Author:** ![Thomas\_Kaltschmidt](https://forum.xojo.com/letter_avatar_proxy/v4/letter/t/f0a364/32.png) [@Thomas\_Kaltschmidt](https://forum.xojo.com/u/Thomas_Kaltschmidt)\
**Post date:** [October 29, 2026, 11:25am UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/11 "2026-10-29T11:25:40Z")

</div>

May the right and bottom border got simply clipped? Did you try this?

```auto
// DesktopCanvas CornerSize problem - OK

var mypen as double = 20
g.DrawingColor = color.green
g.FillRoundRectangle(0,0,canvas1.Width-30,canvas1.height-30,80,80)
g.PenSize = mypen
g.DrawingColor = color.black
g.drawRoundRectangle(0,0,canvas1.Width-30,canvas1.height-30,80-mypen,80-mypen)

```

---

<div class="post-metadata">

**Author:** ![Boris\_Klusmeyer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/dfb087/32.png) [@Boris\_Klusmeyer](https://forum.xojo.com/u/Boris_Klusmeyer)\
**Post date:** [October 29, 2026, 12:06pm UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/12 "2026-10-29T12:06:36Z")

</div>

The picture I have posted is´the DesktopRectangle.

There is no way to paint the Border by yourself.

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [October 29, 2026, 12:43pm UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/13 "2026-10-29T12:43:10Z")

</div>

> [@Boris\_Klusmeyer](#):
>
> There is no way to paint the Border by yourself.

Of course, it’s possible to paint a border. You have code above.

---

<div class="post-metadata">

**Author:** ![Boris\_Klusmeyer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/dfb087/32.png) [@Boris\_Klusmeyer](https://forum.xojo.com/u/Boris_Klusmeyer)\
**Post date:** [October 29, 2026, 12:57pm UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/14 "2026-10-29T12:57:50Z")

</div>

Ther is no Paint Method in DesktopRectangle!

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [October 29, 2026, 12:59pm UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/15 "2026-10-29T12:59:42Z")

</div>

You can paint in a:

- Window
- Container
- Canvas

---

<div class="post-metadata">

**Author:** ![Boris\_Klusmeyer](https://forum.xojo.com/letter_avatar_proxy/v4/letter/b/dfb087/32.png) [@Boris\_Klusmeyer](https://forum.xojo.com/u/Boris_Klusmeyer)\
**Post date:** [October 29, 2026, 1:12pm UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/16 "2026-10-29T13:12:10Z")

</div>

even at the risk of repeating myself. Canvas is to slow!

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [October 29, 2026, 1:24pm UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/17 "2026-10-29T13:24:49Z")

</div>

> [@Boris\_Klusmeyer](#):
>
> Canvas is to slow!

Not for a simple rectangle. Or you are doing something seriously wrong.

---

<div class="post-metadata">

**Author:** ![Thomas\_Kaltschmidt](https://forum.xojo.com/letter_avatar_proxy/v4/letter/t/f0a364/32.png) [@Thomas\_Kaltschmidt](https://forum.xojo.com/u/Thomas_Kaltschmidt)\
**Post date:** [October 29, 2026, 1:58pm UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/18 "2026-10-29T13:58:04Z")

</div>

What exactly do you mean with „Canvas to slow“?

---

<div class="post-metadata">

**Author:** ![Christian\_Wheel](https://forum.xojo.com/user_avatar/forum.xojo.com/christian_wheel/32/20536_2.png) [@Christian\_Wheel](https://forum.xojo.com/u/Christian_Wheel)\
**Post date:** [October 29, 2026, 11:44pm UTC](https://forum.xojo.com/t/problem-with-border-thickness-of-desktoprectangle/89104/19 "2026-10-29T23:44:20Z")

</div>

Canvas is incredibly fast. If you skip ahead to 16 seconds [in this video](https://streamable.com/iiay6p), this entire UI is one giant canvas. It’s handling audio waveforms, mouse clicks and drags, logical breaking up of track elements, animations and more all in a canvas. You’d probably be able to create a whole video game in a Canvas and get playable frame rates.

I’d highly encourage you to experiment more and see what is slowing down your code, because canvases are lightning fast when properly implemented.
