question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot use colors on winforms

See original GitHub issue

Expected Behavior

Using the packer color attribute to change the color of a Label.

Current Behavior

No color displayed, no errors, widget still gets displayed.

Your Environment

import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW

class AppName(toga.App):
    def startup(self):
        main_box = toga.Box(style=Pack(direction=COLUMN))

        self.id_error = toga.Label(
            'Error',
            style=Pack(visibility='hidden', text_align='center')
        )
        error_box = toga.Box(style=Pack(direction=COLUMN, padding=5))
        error_box.add(self.id_error)

        main_box.add(error_box)
        self.main_window = toga.MainWindow(title=self.formal_name)
        self.main_window.content = main_box
        self.main_window.show()
  • Python Version: 3.7.6

  • Operating System and Version

    • macOS - version:
    • Linux - distro: - version:
    • Windows - version: Windows 10 Pro 1909
    • Other - name: - version:
  • Toga Version: 0.3.0dev18

  • Toga Target

    • android
    • cocoa
    • django
    • gtk
    • iOS
    • tvOS
    • watchOS
    • winforms
    • win32
    • Other (please specify): Desktop app (Windows) --> I don’t know if this is win32 or winforms.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
saroad2commented, Apr 16, 2020

Will be solved on my pull request #844

1reaction
freakboy3742commented, Mar 8, 2020

Thanks for the report! There’s a lot of features on the winforms backend that aren’t currently supported - changing colors is one of them. However, this isn’t reported in the same way as it is with other missing features, so the confusion is understandable.

(And - for future reference: you’re using the winforms backend. We’re in the process of deprecating the win32 backend).

Read more comments on GitHub >

github_iconTop Results From Across the Web

change color of all controls inside the form in c# - Stack Overflow
For example the labels background is behind a property named "BackColor", and datagrid uses a name "BackgroundColor". You can use this code as ......
Read more >
base.BackColor not changing color - MSDN - Microsoft
I have noticed in the Designer it says for the backColor to be control, but even after I take that out, rebuild solution,...
Read more >
Cannot use Color.FromARGB() to set cells Back-Color......
Hello, I`m trying to get a very light gray background for my excel-cells, so first try was to use: sheet[x,y].CellStyle.Color = Color.LightGray;
Read more >
How to use color Dialog in C# | ColorDialog in c - YouTube
A C# Color Dialog control is used to select a color from available colors and also define custom ... Your browser can't play...
Read more >
Windows Form How to change the back color of the form
Your browser can't play this video. ... Windows Form How to change the back color of the form. 33K views 8 years ago....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found