How to prevent a specific color from being selected in the component TColorBox?


Andrey Angerchik

Does anyone know how to remove a certain color from the dropdown in TColorBox?

enter image description here

RBA

You need to remove the color from the list:

procedure TForm7.FormCreate(Sender: TObject);
var i: Integer;
begin
  i := ColorBox1.Items.IndexOf('clGreen');
  if i <> -1 then
    ColorBox1.Items.Delete(i)
  else
    Showmessage('invalid color');
end;

Related


How to prevent text from being selected

Delaza I've searched here and searched SO but haven't found an answer to this question. I know this can be done using user-select:noneCSS , but as you can see this is not a standard property and I'm trying to find an alternative. Note: I don't care if the user

How to prevent text from being selected

Delaza I've searched here and searched SO but haven't found an answer to this question. I know this can be done using user-select:noneCSS , but as you can see this is not a standard property and I'm trying to find an alternative. Note: I don't care if the user

How to prevent text from being selected

Delaza I've searched here and searched SO but haven't found an answer to this question. I know this can be done using user-select:noneCSS , but as you can see this is not a standard property and I'm trying to find an alternative. Note: I don't care if the user

How to prevent text from being selected

Delaza I've searched here and searched SO but haven't found an answer to this question. I know this can be done using user-select:noneCSS , but as you can see this is not a standard property and I'm trying to find an alternative. Note: I don't care if the user

How to prevent the same option value from being selected

Daniel I'm trying to disallow selection of the same option value with the same value, I'm using the same option html id/class, here are several solutions I found using two different option values. How to make sure the two select menu values are different with

How to prevent the same option value from being selected

Daniel I'm trying to disallow selection of the same option value with the same value, I'm using the same option html id/class, here are several solutions I found using two different option values. How to make sure the two select menu values are different with

How to prevent the same option value from being selected

Daniel I'm trying to disallow selection of the same option value with the same value, I'm using the same option html id/class, here are several solutions I found using two different option values. How to make sure the two select menu values are different with

How to prevent the same option value from being selected

Daniel I'm trying to disallow selection of the same option value with the same value, I'm using the same option html id/class, here are a few solutions I've found using two different option values. How to make sure the two select menu values are different with

How to prevent the same option value from being selected

Daniel I'm trying to disallow selection of the same option value with the same value, I'm using the same option html id/class, here are a few solutions I've found using two different option values. How to make sure the two select menu values are different with

How to prevent the same option value from being selected

Daniel I'm trying to disallow selection of the same option value with the same value, I'm using the same option html id/class, here are a few solutions I've found using two different option values. How to make sure the two select menu values are different with

How to prevent selected color from changing on browser refresh

Shaq Sorry, my English is no good.. In my website, I have added some colors to change the color of my website based on the selected color. It works fine. But the problem is when i refresh the window it shows the default color but i want to show the selected co

How to prevent a specific dynamic library from being loaded

Herman I want to use an ancient software (Unreal Tournament "Classic" from 1999, also known as UT99). The dynamic library libtxc_dxtn.sois loaded implicitly in search of optional S3 Texture Compression (S3TC) support. Unfortunately, when loading the library, t