Form Designer bug when using FoxPro dialect and System.Windows.Forms.TextBox.PasswordChar property?

This forum is meant for questions and discussions about the X# language and tools
Post Reply
mindfulvector
Posts: 6
Joined: Tue Jun 24, 2025 1:57 pm
Location: United States

Form Designer bug when using FoxPro dialect and System.Windows.Forms.TextBox.PasswordChar property?

Post by mindfulvector »

When creating a password entry field, while using the FoxPro dialect, I get the following error message:

Code: Select all

error XS0029: Cannot implicitly convert type 'string' to 'char'	221,5	frmMain.prg	frmMain:InitializeForm
The generated code in question is this:

Code: Select all

    SELF:otxtPassword:Location := System.Drawing.Point{120 , 80}
    SELF:otxtPassword:Name := "txtPassword"
    SELF:otxtPassword:PasswordChar := '*'                                                  && <- line 221, error
    SELF:otxtPassword:Size := System.Drawing.Size{248 , 20}
    SELF:otxtPassword:TabIndex := 8
    SELF:Controls:Add(SELF:otxtPassword)
User avatar
Chris
Posts: 5466
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Form Designer bug when using FoxPro dialect and System.Windows.Forms.TextBox.PasswordChar property?

Post by Chris »

Hi Isaac,

Since both single and double quote delimiters are used for specifying strings in the VFP (and others) dialect, you need to explicitly specify that it's a Char, with the "c" prefix:

Code: Select all

SELF:otxtPassword:PasswordChar := c'*'

Btw, is this code written by you, or is it designer generated? Because I checked the designer and it does add the "c" automatically.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
mindfulvector
Posts: 6
Joined: Tue Jun 24, 2025 1:57 pm
Location: United States

Re: Form Designer bug when using FoxPro dialect and System.Windows.Forms.TextBox.PasswordChar property?

Post by mindfulvector »

This is designer generated code, and it does not generate the `c` prefix. Perhaps I am running a slightly out of date version of XIDE, or perhaps this only happens if the project settings are changed in some specific way?
User avatar
Chris
Posts: 5466
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

Re: Form Designer bug when using FoxPro dialect and System.Windows.Forms.TextBox.PasswordChar property?

Post by Chris »

Ah, it's about XIDE, I never thought it was used for writing VFP apps :)

Thanks, I see the problem, will fix it right now. For the moment, please just add the "c" manually.
Chris Pyrgas

XSharp Development Team
chris(at)xsharp.eu
Post Reply