Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I make a Panel respond to Tap events but not allow the TextBox to be edited?
    primarykey
    data
    text
    <p>I have the following code:</p> <pre><code>public class IdentityCell : Panel { public IdentityCell() { Margin = m_zeroThickness; VerticalAlignment = VerticalAlignment.Top; Width = double.NaN; m_labelIcon = new Image(); { m_labelIcon.VerticalAlignment = VerticalAlignment.Center; m_labelIcon.Width = getIconSizeToUseInPixels(); m_labelIcon.Height = getIconSizeToUseInPixels(); } Children.Add(m_labelIcon); m_labelName = new TextBox(); { m_labelName.Margin = m_zeroThickness; m_labelName.VerticalAlignment = VerticalAlignment.Center; m_labelName.TextAlignment = TextAlignment.Center; m_labelName.FontSize = (double) Application.Current.Resources["PhoneFontSizeMediumLarge"]; m_labelName.Padding = m_zeroThickness; m_labelName.IsHitTestVisible = false; m_labelName.BorderThickness = m_zeroThickness; m_labelName.Width = double.NaN; m_labelName.Foreground = m_phoneForegroundBrush; m_labelName.Background = null; } Children.Add(m_labelName); IsHitTestVisible = true; Tap += onTap; } ... } </code></pre> <p>When the m_labelIcon is tapped, onTap() is called. But when m_labelName is tapped, onTap() is NOT called. If I set m_labelName.IsHitTestVisible to true, tapping on m_labelName causes the control to enter edit mode and the onscreen keyboard to popup. m_labelName is supposed to just be a static text control without editing support. I've tried using the IsEnabled or IsReadOnly properties, but these alter the appearance.</p> <p>My TextBox is next to my image. The layout looks like this:</p> <pre><code>---- Panel -------------------- &lt;Image&gt; &lt; TextBox &gt; ---- Panel -------------------- </code></pre> <p>Any help would be appreciated!</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload