|
Hi,
1. yes selection across multiple lines would be a problem.
2. by default lines get drawn in single font, size, color as in a regular TextBox
(as opposed to a RichTextBox). Character coloring (or anything else fancy)
would require you choose the OwnerDrawn model, in which you provide the code
to paint each line yourself (a simple Graphics.DrawString would again
offer the default behavior).
3. yes, maipulating lines is easy through the ListBox.Items property, which
lets you add, remove, insert, and modify lines, either through methods
or by using an indexor.
Conclusion: if you need all the fancy coloring and free selection, then ListBox
is not an option, and you must either go for RichTextBox (and live with
degrading performance in case the text gets really large, which is unlikely in
your app), or go for a Panel and do it all yourself.
BTW Come to think of it, I am not sure you can do all required selection stuff
with what a (Rich)TextBox offers; I am not sure how far an ANSI terminal would go,
IIRC a VT-220 could have multiple selections, some steady some blinking...
Cheers.
|
|
|
|
|
Thanks for the advice Luc, it sounds like I just need to do the terminal from the ground up, or change the design completely. I'm thinking perhaps I will make a localhost proxy for a telnet session to go through (using Windows telnet, with its built-in ANSI support). That way I can capture text from the session and use it to populate a db, and then make a companion app that does things with the data in the db. Once again, thanks for helping a beginner, I'm glad I didn't spend too much time trying to do this the wrong way.
|
|
|
|
|
You're welcome.
|
|
|
|
|
Sorry to keep dragging this out, but a thought occurred to me: would it be possible to just spawn a command prompt inside a Windows form and run the standard telnet.exe through it? As long as I could send input to it and read what it outputs, that would get me where I need to go, since cmd includes ANSI support via ANSI.sys. I know I can spawn .bat's and .exe's as external processes, but I don't know if it's possible to do something like that within a form and interact with it. Thanks again in advance.
|
|
|
|
|
Hi,
in general this is possible. You need the Process class to do it, and you should:
- either redirect Input, Output and Error streams (and create 3 separate threads to
handle them) but that would not solve your problem, since then you have to show
it again,
- or adopt its Window into your app; IIRC I read a CodeProject article
on that but I have forgotten the details on how to do it. Sorry.
|
|
|
|
|
Hi all,
Does anyone know how you can get an event for when the user clicks on a listbox's verticle scrollbar?, i used a myListBox.Click event, but that only works when I click inside the listbox, not on the scrollbar.
I've been experimenting with overriding the WndProc() method but cant seem to achieve what i want.
Any idea would be greatly appreciated.
Regards,
Mark.
|
|
|
|
|
Hi,
I dont think there is any event related to scrolling.
What would you want to do with a scroll event ?
maybe you could use the Paint event and check whether TopIndex has changed.
|
|
|
|
|
hi mark, use DropDown event try.
private void comboBox1_DropDown(object sender, EventArgs e)
{
MessageBox.Show("hello");
}
cool
|
|
|
|
|
I am about to do a software for a medical comlex doctor and staff working schedule and I want to know if some one did a similar application..what componant most people use? I am looking for a good and free or cheap control..
|
|
|
|
|
This sounds to me like something you'd just use a gridview for, or a datagrid perhaps.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Hey!
Is it possible to communicate in client server application through SSL even if the authentication is not done.
I mean i have to communicate with a H/W through ssl and it can not be authenticated by certificates. I am using objects of sslstream class to communicate.
Thanks
Tariq
|
|
|
|
|
Hey !
I am using Openssl to create a new certificate for ssl authentication in a client server application.
But when the authentication starts using SslStream methods authenticateAsserver() and authenticateAsclient()
i got the following exception
[System.NotSupportedException] {"The server mode SSL must use a certificate with the associated private key."} System.NotSupportedException
regards
Tariq
|
|
|
|
|
Hi all.
I have method which will listens for incoming message..i have written this method inside a thread
I have called UDPClientobject.Recieve(ref remoteIpEndPoint).now i want to add a timespan to this recieve method so that after specified time it should get out the loop..how should i add a time span value in recieve method.
Can any show me how to do.
Regards
Regards
DilipRam
|
|
|
|
|
Hi,
I havent used it, but there is UdpClient.BeginReveive() which starts an asynchronous receive.
The example in MSDN shows how you can do other things while it works for you.
|
|
|
|
|
Hi,
i'm new at C# and i have a question for you. I've created a windows service and also the project installer for it. Now i've also created the setup project for it and it works fine. This is the problem: if i want to start the service after the setup, i've to start it manually, but i want to do it automatically at the end of the setup program. How can i do it? Can you help me?
Thank you all.
Gianluca
|
|
|
|
|
|
I have developed an application that will upload files to FTP Server as part of its task. Now it works quite well most of the time. But sometimes it gets web exception-called timeout exception -
System.Net.WebException: The operation has timed out. at System.Net.FtpWebRequest.GetRequestStream()
I searched in google and didn't find any useful help.
I saw an attibute (in FtpWebRequest class) called Timeout. I didn't set any value to it, cause i assumed that the default value will do. But now that it gets timeout exceptions , what should i do?
1. Can i solve it Just by setting some high value in this(timeout) attribute ? will it have any performance overhead ?
2. I am using FtpWebRequest. I am sending synchronous calls. Do I need to change it to asynchronous calls or it will be all the same? Is there any relation between time out and Sync/ASync calls ?
I am finding no solution to this. So i will be waiting for a help from this forum.
thanks
-- modified at 13:46 Wednesday 4th July, 2007
Chayan
|
|
|
|
|
hello,
i went through the articles in CP and i found some good samples to create a gmail notifier using gmail feeds..but i want to know is it possible to create an application to notify instantly whenever an email comes to my gmail account..something like in google talk or yahoo messenger
aneef
|
|
|
|
|
Why not to use the notifier from Google?
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
im asking for a developer solution..not a software recommendation.. lolz..
aneef
|
|
|
|
|
Just thought that you might have looked for that because you didn't wrote "like the notifier from Google"
-^-^-^-^-^-
no risk no funk
|
|
|
|
|
i want a code like given below in which when i send the URL the CAPTCHA inside it should also come. here the problemis that the CAPTCHA has no specific number or id
it has only reference site and when we click it the captcha always changes. so plz give me a code that gives the appropriate captcha
private string send_Request_Data(string link, string post_data)
{
string url = string.Format(link);
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
//if (proxy_enabled && proxy != null)
{
//request.Proxy = proxy;
}
request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30) Firefox/0.9.2";
request.Method = "GET";
request.Accept = "image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword, application/xaml+xml, application/vnd.ms-xpsdocument, application/x-ms-xbap, application/x-ms-application, */*";
request.KeepAlive = true;
request.ContentType = @"application/x-www-form-urlencoded";
request.Referer = string.Format("http://www.bebo.com");
request.CookieContainer = new CookieContainer();
request.CookieContainer.Add(cookies);
if (post_data != null)
{//post the data to the desired link
string postData = string.Format(post_data);
request.Method = "POST";
byte[] postBuffer = System.Text.Encoding.GetEncoding(1252).GetBytes(postData);
request.ContentLength = postBuffer.Length;
Stream postDataStream = request.GetRequestStream();
postDataStream.Write(postBuffer, 0, postBuffer.Length);
postDataStream.Close();
}
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
response.Cookies = request.CookieContainer.GetCookies(request.RequestUri);
cookies.Add(response.Cookies);
Encoding enc = System.Text.Encoding.UTF8;
StreamReader responseStream = new StreamReader(response.GetResponseStream(), enc, true);
string responseHtml = responseStream.ReadToEnd();
response.Close();
responseStream.Close();
return responseHtml;
}
|
|
|
|
|
Please, PLEASE, don't put 'C#' as your header, every question here is about C#.
As has been said before, people who put captha stuff on their sites, do so exactly to stop what you're trying to do. Why do you need to do this ?
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Let me get this straight. You want code to read the CAPTCHA image, figure out what characters it's supposed to send and then submit the form with the correct response to the CAPTCHA?
You do realize that CAPTCHA was created to stop the automated submission of forms, right?
|
|
|
|
|
you have to wonder if he's trolling.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|