Download data/DWSIM.ExtensionMethods/DropDownWidth.vb from introvoyz041/Dwsim: direct link, hf CLI and curl.
- Browser
- Download file 607 Bytes
-
https://huggingface.co/datasets/introvoyz041/Dwsim/resolve/main/data/DWSIM.ExtensionMethods/DropDownWidth.vb
- Command line
-
hf download hf://datasets/introvoyz041/Dwsim/data/DWSIM.ExtensionMethods/DropDownWidth.vb
-
curl -L -o DropDownWidth.vb https://huggingface.co/datasets/introvoyz041/Dwsim/resolve/main/data/DWSIM.ExtensionMethods/DropDownWidth.vb
607 Bytes
| Imports System.Windows.Forms | |
| Public Module DropDownWidth | |
| <System.Runtime.CompilerServices.Extension()> | |
| Public Sub SetDropDownMaxWidth(ByVal myCombo As ComboBox) | |
| Dim maxWidth As Integer, temp As Integer = 0 | |
| maxWidth = myCombo.Width | |
| Try | |
| For Each obj In myCombo.Items | |
| temp = TextRenderer.MeasureText(obj.ToString(), myCombo.Font).Width | |
| If temp > maxWidth Then maxWidth = temp | |
| Next | |
| Catch ex As Exception | |
| End Try | |
| If maxWidth > 0 Then myCombo.DropDownWidth = maxWidth | |
| End Sub | |
| End Module | |