when the searching text is found it should be highlighted
If you are using rich text editor, you can do it easily. This control having methods to get and set the selection. Try for some richtext documentations.
i want to implement line number functionality in my editor
My idea is keep one listbox near to textbox. apply all the styles for the listbox., According to the changes in richtext editor create line numbers and add to listbox. Make use of threading for better performance.
Of course you could do this yourself, but why should you if there are already several(three at least) controls on CodeProject which do just what you want. I have tried several of them out, and I think that for speed and functionability, the one by Uri Guy is the best. Here is the article-> Syntax highlighting textbox written in C#
I am a novice of .NET. I am planning to write an application in C#.NET which is meant to serve a purpose of like "post-it" which would certainly need to be memory resident without any main window. Can I achieve this using Windows Forms name space?
May be yes. We can hide the application window and display the "notes" windows. but there should be one source i mean an icon upon which clicked, a context menu can be displayed to configure settings or close the application if needed. For this i think its needed to show an icon in the system tray.
Their should probably be a registry hive somewhere that stores the add/remove list of programs installed on the machine, I can't really help with the System.Management namespace though.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Normally you use the "&" when naming menu items. If you run your program the character preceded by the ampersand is underlined in every menu item and you can "simulate" clicking the menu item by pressing the respective character whilst holding Alt. So it allows users to access the menu without using the mouse.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
I have a Usercontrol that contains several controls. There is onlye one of these controls that may ba focused by using tab(tab index = 1 and tabstop = true). The other controls in this usercontrol have index = 0 and tabstop = false.
On the mouse over event on this focusable control i se the control to focus(ex this.txtBox.Focus();) and this works fine.
But when i try to use Tab to leave the usercontrol there simes like another control get focused and I have to press tab twice to leave the usercontrol.
Any ide how to lose the focus/activ of the usercontrol on TAB? I want the next usercontrol or regular control to become focused on one TAB press.
I am facing a PROBLEM WHILE I send mails with the SMTP class of System.Net.Mail.
The code shows below.
MailMessage mail = new MailMessage();
//set the addresses
mail.From = new MailAddress("email@example.com");
//set the content
mail.Subject = "This is an email";
mail.Body = "this is the body content of the email.";
//send the message
SmtpClient smtp = new SmtpClient("mysmtpserver.net");
//to authenticate we set the username and password properites on the SmtpClient
smtp.Credentials = new System.Net.NetworkCredential("firstname.lastname@example.org", "password");
I have a valid smtp server name, username and password. I configured it to outlook and working fine. And wen I test it using telnet port 25 then also its working.
I upload the file to my hosting space. I have two hosting account with godaddy.
The mailing script is working fine in one hosting account. That hosting account have SSL and dedicated IP address.
But the mailing code is not working in the other hosting account. That hosting account is Windows hosting + ASP.NET 2.0 supported.
The error I am getting is as shown as below.
System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at _Default.Button1_Click(Object sender, EventArgs e)
Please help me on this issue....
Thanks in advance....
I am writing an simple application that will delete a file/directory. The application recives the target file as an argument. I have also put a shortcut in the W Explorer contextual menu, via Shell registry subkey of the folder entry
in the HKEY_CLASSES_ROOT.
@="Wipe it ..."
If a launch the program from a shell with an filename/folder as an argument it does it's job.
But if the program is launched via the option in the Explorer menu and the selected targer is a folder (with a simple file it works), then the deleting fails with the exception " ... file being used by another process". It seems that the program keeps an open handle on the directory. The delete operation is made via Directory.Delete() ( tried also working with DirectoryInfo ...same result).
Any one has any idea how can I get past this ?
LATER EDIT : I managed to track the problem after all. Simple stuff really, but forgot about it. Windows set the current directory for the program was set to be the target directory, so a simple change of the current directory was enough to get the program going.
I am trying to create an application that simply starts listening on a specific port number on the local machine, and writes all data received to a text box on the form. There will be a 3rd party application that is sending data th my IP address on a specific port number.
From what ive been reading, maybe I should use a TCPListener but Im not sure where to start.
Any help would be appreciated.
Last Visit: 31-Dec-99 18:00 Last Update: 28-Oct-21 4:25