Hi,
I have a problem using the KeyDown event while being in readonly mode.
In a form, I can't catch CTRL+"something" keys (ex. ctrl+e) while the focus being on a readonly UltraTextEditor usercontrol. The control fires one key or the other, but never both of them.In edit mode, it works.
Is there difference between edit and readonly mode for managing key events?
Thank you for your help.
(I'm using NetAdvantage for .NET 2007 Vol. 3 CLR 2.0)
That sounds like a bug to me. You should Submit an incident to Infragistics Developer Support
Sorry, It's not clear.I created a form containing UltraTextEditor controls and I want to catch some key shortcuts for editing and saving (CTRL+E, CTRL+S). I’m catching keys with the form KeyDown event, using form.KeyPreview = true.I’ve found that when the UltraTextEditor control is in readonly mode and having focus, the form do not receive some specific key combination, like CTRL+E, CTRL+R or CTRL+J.There’s a specific sample.If pressing CTRL+E in both edit and readonly mode, the KeyDown event will be raised in edit mode, but nothing happen in readonly mode.The sample class :___________________________________________________________________________________
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Windows.Forms;namespace InfragisticsTest{ public partial class Form1 : Form { public Form1() { InitializeComponent(); this.KeyPreview = true; this.KeyDown += new KeyEventHandler(Form1_KeyDown); } void utxtEditor_KeyDown(object sender, KeyEventArgs e) { this.Text = e.KeyData.ToString(); } void Form1_KeyDown(object sender, KeyEventArgs e) { utxtKeys.Text = utxtKeys.Text + "\r\n" + e.KeyData.ToString(); } private void ultraButton1_Click(object sender, EventArgs e) { ultraTextEditor1.ReadOnly = !ultraTextEditor1.ReadOnly; } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.ultraTextEditor1 = new Infragistics.Win.UltraWinEditors.UltraTextEditor(); this.ultraButton1 = new Infragistics.Win.Misc.UltraButton(); this.utxtKeys = new Infragistics.Win.UltraWinEditors.UltraTextEditor(); ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor1)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.utxtKeys)).BeginInit(); this.SuspendLayout(); // // ultraTextEditor1 // this.ultraTextEditor1.Location = new System.Drawing.Point(12, 12); this.ultraTextEditor1.Name = "ultraTextEditor1"; this.ultraTextEditor1.Size = new System.Drawing.Size(132, 21); this.ultraTextEditor1.TabIndex = 0; // // ultraButton1 // this.ultraButton1.Location = new System.Drawing.Point(150, 12); this.ultraButton1.Name = "ultraButton1"; this.ultraButton1.Size = new System.Drawing.Size(132, 23); this.ultraButton1.TabIndex = 1; this.ultraButton1.Text = "Set/Unset readonly"; this.ultraButton1.Click += new System.EventHandler(this.ultraButton1_Click); // // utxtKeys // this.utxtKeys.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.utxtKeys.DisplayStyle = Infragistics.Win.EmbeddableElementDisplayStyle.Office2007; this.utxtKeys.Location = new System.Drawing.Point(11, 44); this.utxtKeys.Multiline = true; this.utxtKeys.Name = "utxtKeys"; this.utxtKeys.ReadOnly = true; this.utxtKeys.Scrollbars = System.Windows.Forms.ScrollBars.Vertical; this.utxtKeys.Size = new System.Drawing.Size(270, 187); this.utxtKeys.TabIndex = 2; // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(293, 243); this.Controls.Add(this.utxtKeys); this.Controls.Add(this.ultraButton1); this.Controls.Add(this.ultraTextEditor1); this.Name = "Form1"; this.Text = "Form1"; ((System.ComponentModel.ISupportInitialize)(this.ultraTextEditor1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.utxtKeys)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); } #endregion private Infragistics.Win.UltraWinEditors.UltraTextEditor ultraTextEditor1; private Infragistics.Win.Misc.UltraButton ultraButton1; private Infragistics.Win.UltraWinEditors.UltraTextEditor utxtKeys; }}
I don't understand what you are describing. Can you explain in more detail exactly what you mean?