MaximumSoftkeyLabelLength Property
Returns the maximum length of the text that a softkey label can display. The default value is 5.
public virtual int MaximumSoftkeyLabelLength {
get
}
Example
The following example demonstrates how to use the MaximumSoftkeyLabelLength property to determine the length of label to render.
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";
}
}
See Also
Applies to: MobileCapabilities Class