MaterialSkin: Get a dropdown list control, and keep single-line text boxes a sensible size

61 Views Asked by At

I am working on updates to an application, developed by a colleague, which uses MaterialSkin v0.2.1.

I am trying to add dropdown list boxes. The original MaterialSkin doesn't have these, but I have tried a few of the various forks in NuGet. However, I am having no end of problems.

Among them is MaterialSkin.2, which has a very changed API. Some of the others appear to be forks of this. Among the API changes, whereas the original MaterialSkin has MaterialSingleLineTextField, MaterialSkin.2 has MaterialTextBox and MaterialTextBox2 as the only text box classes. Unfortunately, these controls have an excessive amount of vertical padding, and the height is locked at 50 and 48 respectively. This is much too big. I can't find any way to get the height down to something more sensible, like 23 as it is in the original.

All the versions of MaterialSkin I've tried so far fall under one of two categories:

  • Has the original API and doesn't have the textbox size problem, but doesn't have a dropdown list control (meaning I'm stuck with standard Winforms comboboxes, creating an inconsistent L&F)
  • Has the changed API and has a dropdown list control, but has the textbox size problem

With those of the second category, I haven't been able to get the height down to something sensible. I haven't managed to find one that has a dropdown list control and doesn't have the textbox size problem.

Can anyone help?

1

There are 1 best solutions below

0
John Dauphiny On

We use MaterialSkin.2 (leocb, IgnaceMaes, orapps44) (v2.2.1 - 2.3.1 doesn't work for us; too many redraw issues). With MaterialSkin.2, text boxes have an option "UseTallSize". By default, it's TRUE - with a default 50 tall. When set to FALSE, the height is 36. Not the 23 that you're hoping for, but better than the 50.

Also, when TRUE, you can see the hint even if there is text in the box. If FALSE, the hint will be hidden if the box has contents.

My primary issue with this set is that the cursor sometimes goes out of sync in text boxes. So, you'll see the cursor bar a character or two from the text it's actually next to. Seems to be somewhat random.

I will also add, the drop downs are simple dropdown lists only. They are not combo boxes. I have yet to get something like auto-complete to work with them. So, if you need true combo boxes, this isn't going to suit your needs.