コンボボックスの高さが正しくズームされない場合がある
対象製品
MultiTouch for Windows Forms 1.0J
状況
修正済み
詳細
下記の条件を満たした場合、フォームをズームしてもコンボボックスの高さが変更されません。
・コンボボックスのフォントサイズが既定値から一度変更されている
・コンボボックスのDropDownStyleプロパティにDropDownListが設定されている
・ズームを行う前にコンボボックスが表示されていない状態である
(VisibleプロパティがFalse、または現在表示されていないタブページに配置されている)
・コンボボックスのフォントサイズが既定値から一度変更されている
・コンボボックスのDropDownStyleプロパティにDropDownListが設定されている
・ズームを行う前にコンボボックスが表示されていない状態である
(VisibleプロパティがFalse、または現在表示されていないタブページに配置されている)
回避方法
この問題はService Pack 3(v1.0.2015.1127)で修正されました。
不具合を修正した最新のサービスパックは、アップデートページ からダウンロードできます。
また、下記のようにコンボボックス用のズームポリシーを新たに定義して適用することで回避することが可能です。
1. 次のコードでNewComboBoxZoomPolicyクラスを作成します。
[Visual Basic]
Public Class NewComboBoxZoomPolicy
Inherits GrapeCity.Win.MultiTouch.ComboBoxZoomPolicy
Public Overrides Sub ZoomFont(control As Control, infos As GrapeCity.Win.MultiTouch.ZoomFontInfo)
If (Not control.IsHandleCreated) Then
Dim currentFont As Font = New Font(control.Font.FontFamily, infos.CurrentFontSize, control.Font.Style, control.Font.Unit, control.Font.GdiCharSet, control.Font.GdiVerticalFont)
control.Font = infos.Zoom(currentFont)
Else
MyBase.ZoomFont(control, infos)
End If
End Sub
End Class
[C#]
public class NewComboBoxZoomPolicy : GrapeCity.Win.MultiTouch.ComboBoxZoomPolicy
{
public override void ZoomFont(Control control, GrapeCity.Win.MultiTouch.ZoomFontInfo infos)
{
if ((!control.IsHandleCreated))
{
Font currentFont = new Font(control.Font.FontFamily, infos.CurrentFontSize, control.Font.Style, control.Font.Unit, control.Font.GdiCharSet, control.Font.GdiVerticalFont);
control.Font = infos.Zoom(currentFont);
}
else
{
base.ZoomFont(control, infos);
}
}
}
2. フォームのLoadイベントに以下のコードを追加します。
[Visual Basic]
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
GcZoom1.ZoomPolicies.Add(New NewComboBoxZoomPolicy())
End Sub
[C#]
private void Form1_Load(object sender, EventArgs e)
{
gcZoom1.ZoomPolicies.Add(new NewComboBoxZoomPolicy());
}
不具合を修正した最新のサービスパックは、アップデートページ からダウンロードできます。
また、下記のようにコンボボックス用のズームポリシーを新たに定義して適用することで回避することが可能です。
1. 次のコードでNewComboBoxZoomPolicyクラスを作成します。
[Visual Basic]
Public Class NewComboBoxZoomPolicy
Inherits GrapeCity.Win.MultiTouch.ComboBoxZoomPolicy
Public Overrides Sub ZoomFont(control As Control, infos As GrapeCity.Win.MultiTouch.ZoomFontInfo)
If (Not control.IsHandleCreated) Then
Dim currentFont As Font = New Font(control.Font.FontFamily, infos.CurrentFontSize, control.Font.Style, control.Font.Unit, control.Font.GdiCharSet, control.Font.GdiVerticalFont)
control.Font = infos.Zoom(currentFont)
Else
MyBase.ZoomFont(control, infos)
End If
End Sub
End Class
[C#]
public class NewComboBoxZoomPolicy : GrapeCity.Win.MultiTouch.ComboBoxZoomPolicy
{
public override void ZoomFont(Control control, GrapeCity.Win.MultiTouch.ZoomFontInfo infos)
{
if ((!control.IsHandleCreated))
{
Font currentFont = new Font(control.Font.FontFamily, infos.CurrentFontSize, control.Font.Style, control.Font.Unit, control.Font.GdiCharSet, control.Font.GdiVerticalFont);
control.Font = infos.Zoom(currentFont);
}
else
{
base.ZoomFont(control, infos);
}
}
}
2. フォームのLoadイベントに以下のコードを追加します。
[Visual Basic]
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles Me.Load
GcZoom1.ZoomPolicies.Add(New NewComboBoxZoomPolicy())
End Sub
[C#]
private void Form1_Load(object sender, EventArgs e)
{
gcZoom1.ZoomPolicies.Add(new NewComboBoxZoomPolicy());
}
キーワード
MTTK10728