-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
external-OS-issueIssue caused by an external OS component such as Common Controls.Issue caused by an external OS component such as Common Controls.investigateItems we want to investigate before making a decision on an issueItems we want to investigate before making a decision on an issue
Milestone
Description
.NET version
net9.0-windows
Did it work in .NET Framework?
Not tested/verified
Issue description
Pressing Ctrl+Backspace in a TextBox that has no selection and has ReadOnly set to true modifies its text as if it were not read-only if AutoCompleteMode and AutoCompleteSource are not None.
Attached is a minimal reproduction. In a more realistic scenario, ReadOnly might be set to true in response to an event, some time after it was initialized as false.
Steps to reproduce
Bug.fsproj
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net9.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup>
<Compile Include="Program.fs" />
</ItemGroup>
</Project>
Program.fs
open System
open System.Windows.Forms
[<EntryPoint; STAThread>]
let main _ =
let tb =
new TextBox
( AutoCompleteMode = AutoCompleteMode.SuggestAppend
, AutoCompleteSource = AutoCompleteSource.CustomSource
, Text = "abc"
, ReadOnly = true
)
let f = new Form()
f.Controls.Add tb
f.ShowDialog() |> ignore
0
dotnet run
Ctrl+Backspace deletes text if there is no selection.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
external-OS-issueIssue caused by an external OS component such as Common Controls.Issue caused by an external OS component such as Common Controls.investigateItems we want to investigate before making a decision on an issueItems we want to investigate before making a decision on an issue