2010-08-12 16 views
1

J'ai le code suivant qui fonctionne très bien dans toutes les instances sauf une.L'info-bulle ne s'affiche pas pour le contrôle imbriqué

private void tbxLastName_EditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e) 
{ 
    GetRemainingChars(sender); 
} 

public void GetRemainingChars(object sender) 
{ 
    var control = sender as TextEdit; 
    var maxChars = control.Properties.MaxLength; 
    tipCharacterCounter.Show(control.Text.Length + "/" + maxChars, this, control.Location.X, control.Location.Y - control.Height); 
} 

Je répète que ce processus de toute textbox. Malheureusement, j'ai un contrôle qui est plus compliqué et je n'arrive pas à le faire fonctionner. La partie Event ressemble à ceci ->

private void memDirectionsToAddress_Popup(object sender, EventArgs e) 
{ 
    MemoExPopupForm popupForm = (sender as DevExpress.Utils.Win.IPopupControl).PopupWindow as MemoExPopupForm; 
    MemoEdit meDirections = popupForm.Controls[2] as MemoEdit; 
    meDirections.EditValueChanging += new DevExpress.XtraEditors.Controls.ChangingEventHandler(meDirections_EditValueChanging); 
} 

void meDirections_EditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e) 
{ 
    GetRemainingChars(sender); 
} 

Ce que je ne comprends pas si je remplace la partie tipCharacterCounter avec, par exemple la mise à jour d'une étiquette, il fonctionne très bien. C'est comme si l'info-bulle est cachée ou quelque chose mais j'ai essayé de nourrir Show() différents points en vain.

Des idées?

Répondre

1

Quelle version de DXPerience utilisez-vous? J'ai essayé le code suivant en utilisant DXperience 10.1.5 et cela fonctionne bien ici:

private void memoExEdit1_Popup(object sender, EventArgs e) { 
    MemoExPopupForm popupForm = (sender as DevExpress.Utils.Win.IPopupControl).PopupWindow as MemoExPopupForm; 
    MemoEdit meDirections = popupForm.Controls[2] as MemoEdit; 
    meDirections.EditValueChanging += new DevExpress.XtraEditors.Controls.ChangingEventHandler(meDirections_EditValueChanging); 
} 

void meDirections_EditValueChanging(object sender, DevExpress.XtraEditors.Controls.ChangingEventArgs e) { 
    GetRemainingChars(sender); 
} 

public void GetRemainingChars(object sender) { 
    TextEdit control = sender as TextEdit; 
    int maxChars = control.Properties.MaxLength; 
    tipCharacterCounter.ShowHint(control.Text.Length + "/" + maxChars, control, ToolTipLocation.RightBottom); 
} 
+0

10.1.4 J'utilisais Windows ToolTip au lieu de DevEx. Je ne sais pas pourquoi, mais cela fonctionne très bien avec DevEx. Merci. –