|
Try this:
Create 2 forms:
1.This form should contain the RichText box control and a button to open
the second form.
2.This form should contail a TextBox and a button to find the text
entered in the TextBox.
code for Form1(Show find Dialog button):
========================================
Form Form2=new Form();
Form2.RichTextBoxToFind=EditingArea; //Creating instance for Form2.
Form2.Show();
code for Form2:
===============
Have a public member in the class:
class Form2:System.......
{
public RichTextBox RichTextBoxToFind;
FindButton_Click()
{
int position = RichTextBoxToFindFind(FindTextBox.Text, 0, RichTextBoxFinds.None);
RichTextBoxToFind.SelectionStart = RichTextBoxToFind.SelectionStart + position;
}
}
This is the simplest way of doing this.
But we have to do like how Mr.Patrick suggested.
Hope , this helps U.
Regards,
Arun Kumar.A
|
|
|
|
|
Hi Arun Kumar, ask him to do the work.
Let him work on the application what he got.
if he get any error we can help here dont help him by providing the code .
pls suggest the ideas for developing the application.Dont give him the code as you have provided here.
Regards,
Satips.
|
|
|
|
|
Thank You Mr.Satips.
I will follow Ur suggestion.
Regards,
Arun Kumar.A
|
|
|
|
|
|
this article will help you in developing your application.
Regards,
Satips.
|
|
|
|
|
Hi,
I want to filter the productID that starts with "MDF", so I use
bindingsource1.filter = "productID like 'NAPLE 5'-02'" (look like sql query), but it's not working. After that I corrected bindingsource1.filter = bindingsource1.filter ="productID like 'NAPLE 5%-02'" , it's also not working and appear error "The expression contains an invalid string constant:'. "
Somebody could correct the code will be appreciated.
Thanks in advance.
It seem to be a solution or an answer.
|
|
|
|
|
phantanagu wrote: I want to filter the productID that starts with "MDF"
for what ur saying here it should be something like this, I think..
bindingsource1.Filter = "ProductID LIKE 'MDF%'";
phantanagu wrote: bindingsource1.filter = "productID like 'NAPLE 5'-02'"
What ur trying to do here is a ? for me
hope it helps
Rocky
|
|
|
|
|
Hi,all
I'm looking for some regular expressions to check whether a string is a File/Folder path.Anyone can help me?
Thanks!
|
|
|
|
|
^(([a-zA-Z]\ |(\\))(\\{1}|((\\{1})[^\\]([^/:*?<>"|]*))+)$
this might be helpful to u, I havent tried it out myself though but I've googled it out right now.
|
|
|
|
|
Thanks a lot!
It works excellent.
I find a small bug in it.The regular will match
c:\hello\dl\\\\\\\\\\\\\\\\\sdfsdfsdf\\asdf.
|
|
|
|
|
Hi... could anybody help me?? i gt this error "Error 4 Expected class, delegate, enum, interface, or struct".. i don't understand what it means.. can someone solve for me.. this is my code..
string{} tx_data = new string{13};
string{} rx_data = new string{9};
public int i;
|
|
|
|
|
Are these codes written by C#?
If these written by c#,let them in a class.And if you want to declare a string array,you should write like this:
string[] str=new string[]{"china","beijing"};
I think
string{} tx_data = new string{13};
should be replaced by
string[] tx_data = new string[]{"13"};
Good luck.
|
|
|
|
|
xibeifeijian wrote: string{} tx_data = new string{13};
This is wrong
xibeifeijian wrote: string[] tx_data = new string[]{"13"};
This is right.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi.
This is sorta no brainer question for some of you, but does anyone know the C# codes to clear all contents of a certain notepad file?
thanks a bunch
|
|
|
|
|
one way would be to use a streamWriter object and clear all the contents of the file and close the same.
Keshav Kamat
India
|
|
|
|
|
Try this please:->
using System.IO;
FileStream fs=new System.IO.FileStream(yourTxtFilePath,FileMode.Create);
fs.Close();
|
|
|
|
|
xibeifeijian ,code works perfectly!
thanks alot xibeifeijian and Keshav!!
|
|
|
|
|
Hi,
I attempting to build an applications where I have three forms. MainForm, FormA, and FormB.
MainForm simply has a single button (for now) that pops FormA and FormB.
private void button1_Click(object sender, EventArgs e)
{
formA.Show();
formB.Show();
}
What I'm trying to do is have focus automatically change between FormA and FormB dependant on the users actions. IE. the user enters data on FormA, presses submit. While FormA is waiting for an answer from the server, and want focus to change to FormB so the user can continue to work.
any clues on how do to this in C# ? (using Visual Studios 2005)
|
|
|
|
|
Ok, I got delegates to work...though not pretty (so if you have a nice clean way of doing it, please let me know).
But now I've discovered another problem. While FormA is working, FormB does pop to the front what really isn't active until FormA completes its work. This defeats the purpose of have two forms. IE. To allow the user to continue to work while one form is busy.
Is this not possible in C# .NET? It's easy enough to do in with a browser and child windows so I would think something as advanced as C# should be able to do the same.
|
|
|
|
|
Have you tried a function of Form class, Form.Focus()? If you call formA.Focus(), formA gets focus. If you call formB.Focus(), formB gets focus.
Sheng
|
|
|
|
|
Yes, I can use the Focus by using delegates. But I can not do a formA.Focus() from formB since formB is not aware of formA.
And when I do delegates, I can set the focus, however the focus is not taking place until after previous form completes it works...which in my case makes having two forms useless since the purpose is to allow the user to work on one form while the other form is being processed.
|
|
|
|
|
formA obFormA = new formA();
obFormA.Show();
You can use the same to toggle between the forms or change the focus by showing or hiding any form, maybe while waiting for the server to show.
i.e. you can hide the formA and show the formB
Keshav Kamat
India
|
|
|
|
|
yes, but how.
if from FormB I do:
FormA formA = new FormA();
formA.Show();
All this does is create a NEW formA, not put Focus on the existing FormA.
And if I do formA.Focus() within formB, it will not compile. It'll get a formA does not exist error.
|
|
|
|
|
Dear friends:
How can I make a form unmovable? I tried to set FormBorderStyle to FixedSingle, to enable the form Maximized. But, the form can still be moved around. Thanks!
Sheng
|
|
|
|
|
can you respond to the forms Move event and cancel or undo the change there?
--
CleaKO The sad part about this instance is that none of the users ever said anything [about the problem].
Pete O`Hanlon Doesn't that just tell you everything you need to know about users?
|
|
|
|