Click here to Skip to main content
16,016,736 members
Home / Discussions / C#
   

C#

 
AnswerRe: Send message to Microsoft teams group via connector Pin
lmoelleb19-May-22 0:48
lmoelleb19-May-22 0:48 
GeneralRe: Send message to Microsoft teams group via connector Pin
sdesilets19-May-22 4:44
sdesilets19-May-22 4:44 
QuestionAnyone have experience porting Wonderware scripting to C#.net? Pin
Bruce Armstrong 202218-May-22 6:36
Bruce Armstrong 202218-May-22 6:36 
AnswerRe: Anyone have experience porting Wonderware scripting to C#.net? Pin
Eddy Vluggen20-May-22 4:11
professionalEddy Vluggen20-May-22 4:11 
QuestionIs there any difference in performance when you add a huge amount of data into the database using EF Core (row by row) or using SQL Server stored procedures? Pin
Code4Ever18-May-22 6:25
Code4Ever18-May-22 6:25 
AnswerRe: Is there any difference in performance when you add a huge amount of data into the database using EF Core (row by row) or using SQL Server stored procedures? Pin
Gerry Schmitz18-May-22 7:34
mveGerry Schmitz18-May-22 7:34 
AnswerRe: Is there any difference in performance when you add a huge amount of data into the database using EF Core (row by row) or using SQL Server stored procedures? Pin
Victor Nijegorodov18-May-22 9:27
Victor Nijegorodov18-May-22 9:27 
QuestionHZH_Controls.Controls.UCTextBoxEx Cast Object Error Problem Pin
Eddie You17-May-22 14:15
Eddie You17-May-22 14:15 
Hi, i am using HZH_Controls.Controls.UCTextBoxEx to embed a UCTextBoxEx into a DataGridView control's TextBox field. The program is like below:
C#
private HZH_Controls.Controls.UCTextBoxEx uctextBox1=null;
uctextBox1 = new HZH_Controls.Controls.UCTextBoxEx();
this.uctextBox1.Leave += new EventHandler(uctextBox1_Leave);
this.uctextBox1.TextChanged += new EventHandler(uctextBox1_TextChanged);
this.uctextBox1.Visible = false;
this.uctextBox1.KeyBoardType =  HZH_Controls.Controls.KeyBoardType.UCKeyBorderNum;

private void uctextBox1_Leave(object sender, EventArgs e)
{
    this.uctextBox1.Visible = false;
}

private void uctextBox1_TextChanged(object sender, EventArgs e)
{
     this.dataGridViewAxisDefine.CurrentCell.Value = ((HZH_Controls.Controls.UCTextBoxEx)sender).Text;
     this.uctextBox1.Visible = false;
}

private void DataGridViewAxisDefine_CurrentCellChanged(object sender, EventArgs e)
{
   if ( this.dataGridViewAxisDefine.CurrentCell.ColumnIndex == 2)
   {
          Rectangle rectangle = dataGridViewAxisDefine.GetCellDisplayRectangle(dataGridViewAxisDefine.CurrentCell.ColumnIndex, dataGridViewAxisDefine.CurrentCell.RowIndex, false);

          string value = dataGridViewAxisDefine.CurrentCell.Value.ToString();
          this.uctextBox1.Text = value;
          this.uctextBox1.Left = rectangle.Left;
          this.uctextBox1.Top = rectangle.Top;
          this.uctextBox1.Width = rectangle.Width;
          this.uctextBox1.Height = rectangle.Height;
          this.uctextBox1.Visible = true;
   }
   else
   {
          this.uctextBox1.Visible = false;
          //this.comboBox1.Visible = false;
   }
}

i just want people to click the TextBox field that is on the DataGridView to display a soft number pad and edit the numbers on it.
Now the error apears onto the line "
this.dataGridViewAxisDefine.CurrentCell.Value = ((HZH_Controls.Controls.UCTextBoxEx)sender).Text;
", saying "'
HZH_Controls.Controls.TextBoxEx
' object cannot cast to '
HZH_Controls.Controls.UCTextBoxEx
' "
The TextBoxEx is also a control of
HZH_Controls.Controls
, but i never use it.
The error message is translated from Chinese and may not precisely decribe the original meaning since i am using a Chinese version VS 2017.
So, my question is what's the problem cause this error and how to solve this problem? Many thanks in advance!
AnswerRe: HZH_Controls.Controls.UCTextBoxEx Cast Object Error Problem Pin
Richard MacCutchan17-May-22 21:26
mveRichard MacCutchan17-May-22 21:26 
GeneralRe: HZH_Controls.Controls.UCTextBoxEx Cast Object Error Problem Pin
Eddie You17-May-22 21:41
Eddie You17-May-22 21:41 
AnswerRe: HZH_Controls.Controls.UCTextBoxEx Cast Object Error Problem Pin
Richard Deeming17-May-22 21:27
mveRichard Deeming17-May-22 21:27 
GeneralRe: HZH_Controls.Controls.UCTextBoxEx Cast Object Error Problem Pin
Eddie You17-May-22 21:46
Eddie You17-May-22 21:46 
QuestionUsing Token in a WCF Pin
Luis M. Rojas16-May-22 6:07
Luis M. Rojas16-May-22 6:07 
QuestionSolved!!! Invalid expression term 'uint' Pin
mbah obiora14-May-22 22:41
mbah obiora14-May-22 22:41 
AnswerRe: Invalid expression term 'uint' Pin
OriginalGriff15-May-22 0:09
mveOriginalGriff15-May-22 0:09 
GeneralRe: Invalid expression term 'uint' Pin
mbah obiora15-May-22 1:54
mbah obiora15-May-22 1:54 
GeneralRe: Invalid expression term 'uint' Pin
OriginalGriff15-May-22 2:05
mveOriginalGriff15-May-22 2:05 
QuestionParse complex numbers from string Pin
Member 1563407112-May-22 8:28
Member 1563407112-May-22 8:28 
AnswerRe: Parse complex numbers from string Pin
OriginalGriff12-May-22 9:42
mveOriginalGriff12-May-22 9:42 
AnswerRe: Parse complex numbers from string Pin
jsc4213-May-22 0:13
professionaljsc4213-May-22 0:13 
GeneralRe: Parse complex numbers from string Pin
Member 1563407116-May-22 8:02
Member 1563407116-May-22 8:02 
GeneralRe: Parse complex numbers from string Pin
jsc4217-May-22 3:19
professionaljsc4217-May-22 3:19 
GeneralRe: Parse complex numbers from string Pin
Richard Deeming17-May-22 3:26
mveRichard Deeming17-May-22 3:26 
GeneralRe: Parse complex numbers from string Pin
jsc4217-May-22 5:05
professionaljsc4217-May-22 5:05 
GeneralRe: Parse complex numbers from string Pin
jsc4217-May-22 22:16
professionaljsc4217-May-22 22:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.