我尝试在页面初始化时禁用PrimeNg下拉菜单,如下所示
this.searchForm = this.formBuilder.group({
dropdown: [{value: '', disabled: true}]
});
但这会给出一个浏览器加载错误,如下所示:
this.valueAccessor.setDisabledState is not a function
我在超文本标记语言中使用PrimeNG下拉菜单,如下所示:
<p-dropdown [options]="[{label: 'A
工具栏上有按钮,可以有图像或/和下拉菜单,我有以下代码
int text_width = CalcTextWidth(); // this function use GetTextExtentPoint32
int image_width = CalcImageWidth();
然后,我将按钮宽度设置为text_width + image_width,但是在这样的公式中,文本/图像和边框之间的空格被忽略了,也忽略了下拉箭头元素的大小。
计算工具栏上按钮宽度的正确方法是什么?
P.S. Button_GetIdealSize()为我提供了比我需要的更多的宽度,因为它使用下拉菜单中元素的最大宽度。