Proprietà MaximumSoftkeyLabelLength
Restituisce la lunghezza massima del testo visualizzabile nell'etichetta di un tasto softkey. Il valore predefinito è 5.
public virtual int MaximumSoftkeyLabelLength {
get
}
Esempio
Nell'esempio che segue viene illustrato come utilizzare la proprietà MaximumSoftkeyLabelLength per determinare la lunghezza dell'etichetta di cui eseguire il rendering.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim currentCapabilities As System.Web.Mobile.MobileCapabilities = CType(Request.Browser, System.Web.Mobile.MobileCapabilities)
If currentCapabilities.MaximumSoftkeyLabelLength = 5 Then
Command1.SoftkeyLabel = "Click"
Else
If currentCapabilities.MaximumSoftkeyLabelLength > 5 Then
Command1.SoftkeyLabel = "Submit"
End If
End If
End Sub
[C#]
public void Page_Load(Object sender, EventArgs e)
{
MobileCapabilities currentCapabilities
= (MobileCapabilities)Request.Browser;
if (currentCapabilities.MaximumSoftkeyLabelLength == 5 )
{
Command1.SoftkeyLabel = "Click";
}
else if (currentCapabilities.MaximumSoftkeyLabelLength > 5)
{
Command1.SoftkeyLabel = "Submit";
}
}
Vedere anche
Si applica a: classe MobileCapabilities