I am having a form in which the user is typing a searchable data and I need his value to be printed in a read only textbox which will search for the specific data in my sql server database.
In order to create this typing and printing schedule can be done as string and how can this be searchable in my db?
Thanks in advanced
Loading
George ParoglouPosted May 4, 2011, 1:45 PM
George ParoglouPosted May 4, 2011, 7:39 AM
Ankit NandekarPosted May 4, 2011, 2:15 AM
George ParoglouPosted May 3, 2011, 8:34 AM
Ankit NandekarPosted May 3, 2011, 6:20 AM
welcome george
George ParoglouPosted May 3, 2011, 5:47 AM
Ankit NandekarPosted May 3, 2011, 5:21 AM
George ParoglouPosted May 3, 2011, 4:36 AM
Ankit NandekarPosted May 3, 2011, 4:22 AM
George ParoglouPosted May 3, 2011, 3:51 AM
Ankit I tried your code and even if I made all variables from public to internal it has an error in my firsts form richTextBox:
Error 1 Cannot implicitly convert type 'string' to 'System.Windows.Forms.TextBox'
Sam HobbsPosted May 3, 2011, 2:43 AM
Ankit NandekarPosted May 3, 2011, 2:08 AM
George ParoglouPosted May 3, 2011, 1:49 AM
Ankit I want to pass from a second form any typed data to its previous form. Its the same for the reverse way?
Sam HobbsPosted May 2, 2011, 4:09 PM
Ankit NandekarPosted May 2, 2011, 5:33 AM
to do this
on first forms show button click event (Form to which textbox value u want to pass to unother form,s Textbox)
write following code like if second form namd is Form3 then code will be
Form3 obj = new Form3();
obj.textBox1.Text = richTextBox1.Text;//textbox1 is the textbox name to which u want to show value of first form's textbox
obj.Show();
Note: Do seconds Form's textbox Modifier property internal otherwise it will give error.
George ParoglouPosted May 2, 2011, 4:45 AM
public class IdentityUpdateEventArgs : System.EventArgs
{
// add local member variable to hold text
private string mFirstName;private string mMiddleName;private string mLastName;
// class constructor
public IdentityUpdateEventArgs(string sFirstName, string sMiddleName, string sLastName)
{
this.mFirstName = sFirstName;this.mMiddleName = sMiddleName;this.mLastName = sLastName;
}
}
Sam HobbsPosted May 2, 2011, 1:25 AM
George ParoglouPosted May 1, 2011, 4:36 PM
// add a delegate
public delegate void IdentityUpdateHandler(object sender, IdentityUpdateEventArgs e);// add an event of the delegate type
public event IdentityUpdateHandler IdentityUpdated;I have already included it in my second form...
I tried to create a project absolutly the same as the example and it prints the same error. This error is dissapeared only as soon as the frmAddress.cs is created and I also include the code for the second's form passing data....isn't it strange?
Sam HobbsPosted May 1, 2011, 3:59 PM
George ParoglouPosted May 1, 2011, 3:31 PM
Even if I am transforming this example in my c# project it produces an error in IdentityUpdateEventArgs of my main form
( Error 1 The type or namespace name 'IdentityUpdateEventArgs' could not be found (are you missing a using directive or an assembly reference?))
The following code is the one that marks as error
private void IdForm_ButtonClicked(object sender, IdentityUpdateEventArgs e)
{
// update the forms values from the event args
txtFirstName.Text = e.FirstName;
txtMiddleName.Text = e.MiddleName;
txtLastName.Text = e.LastName;
}
Any suggestions of what is wrong?
Sam HobbsPosted Apr 23, 2011, 3:58 PM
George ParoglouPosted Apr 23, 2011, 3:51 PM
anyone else something more specific?
Sam HobbsPosted Apr 23, 2011, 3:38 PM
George ParoglouPosted Apr 23, 2011, 2:31 PM
Sam HobbsPosted Apr 22, 2011, 5:46 PM
What Jonathas shows is good but appears to not use parameters and for something like this it is better to use parameters.
George ParoglouPosted Apr 22, 2011, 4:48 PM
I try to use the following code...
private void toolStripButton2_Click(object sender, System.EventArgs e){
string Value;
Value = textBox1.Text;
}
but I don't know who to call the readonly richTextBox of another form and place into it the textBox1.Text
Jonathas SucupiraPosted Apr 22, 2011, 4:26 PM
Sam HobbsPosted Apr 22, 2011, 4:21 PM