|
|
hi
i am try to do like this ....
i have a win form textbox and i am trying to write something like "jacal99" using threading with five seconds interval .... the value of thread was thread.sleep(5000);
but when the next charactor try to print in the textbox the first value gone.
i want to pring "jacal99" with five seconds interval .... every charactor...
thx.;)
Mazhar Hussain
|
|
|
|
|
If you post your code it might be easier to help.
Perhaps your assigning the value of Text property everytime and not adding to it:
yourTextBox.Text = "whatever"; //no
yourTextBox.Text += "whatever"; //yes
|
|
|
|
|
Hi again. Still learning C#. This time I managed to create 2 similar controls. I also have a class PropertiesClass that should change some properties (like color and text) of the controls. But after I have changed a property in PropertiesClass, how can I let the other (two) controls know that I did it ? I remind You that I have several controls that must be updated, not just one. I guess the only chance would be using events somehow ?
From my Borland Delphi days I remember using messages (if property is changed I broadcast the message and the controls respond to it) for things like this, but unfortunately (or luckily) .NET doesn't support them...
Best regards, Desmond
|
|
|
|
|
Yes, Raise an event is good solution. Search this site for Delegate and EventHandler keywords and you will find some articles about it. Also take a look at C#/Control part too.
Mazy
No sig. available now.
|
|
|
|
|
I'm very new to C# and I have some questions about writing my own controls (I thought I can learn it best that way). I have two classes - one containing a procedure that paints a area (draws a custom 3D border and background) and another class is a control, witch must call the painting method (that is in the first class) in OnPaint method.
What I don't understand here is how can I pass the area of control as a parameter of the method?
Like in Borland Delphi I would have done it like this:
procedure PaintControl(AreaToPaint: Rect)
Or with two points (one x1, y1 and another x2,x2).
How can I do this in C# ?
If you understood even a little what I'm talking about, please reply....
|
|
|
|
|
On of parameter of your OnPaint is PaintEventArgs (usually named e), and one if its memeber is e.Graphics , pass it to your painting class , you can do painting with it there.
Mazy
No sig. available now.
|
|
|
|
|
desmond5 wrote:
What I don't understand here is how can I pass the area of control as a parameter of the method?
You can call get a rectangle object referencing your control like this:
Rectangle rect = this.Bounds;
SomeMethod(rect);
public void SomeMethod(Rectangle rect)
{
}
- Nick Parker My Blog
|
|
|
|
|
where is "Project Settings (ALT+F7)" of VC++6.0 in VS.NET.
where i could set exe file name, compiler macros etc
|
|
|
|
|
VS.NET IDE -> Solution Explorer -> <right click on root of the tree > properties .
There you are !!
___________________________________________________________
greatest thing is to do wot others think you cant suhredayan@omniquad.com
|
|
|
|
|
Go to Tool menu
Customize---->Option Tab----->Keyboard----->Keyboard Mapping Schema
Select VC++.6 there.
Mazy
No sig. available now.
|
|
|
|
|
Hi,
I am an ex VB programmer learning C# by converting a VB app into C#. In VB I was able to add properties (get and set) to a form so that you could set some properties, display the form so the user could do their bit and the hide the form to read the properties and then close the form.
Is it possible to add properties this way in C#?
I would need to call the form and set the form properties from a button click procedure.
Thanks for any help.
Stephen
|
|
|
|
|
Here's a stub of some code to get you creating get/set properties in C#
public string MyPropertyName
{
get
{
return this.myTextBox.Text
}
set
{
this.myTextBox.Text = value;
}
}
In this example the property is a string , but it can be any type you like.
The keyword value is special and it contains the value the caller want to set the property to.
To use the property you can just assign and use it like any variable.
Does this help?
--Colin Mackay--
EuroCPian Spring 2004 Get Together[^]
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
|
|
|
|
|
It looked pretty close and so I placed it into the form but I was unable to access the property from my buttom click event. How can I make the property so I can access it from the property click event? What I want to achieve ( using the example given) is frmMyform.MyPropertyName = value;
Thanks.
Stephen
|
|
|
|
|
Sorry I don't understand what you are asking.
Properties don't have events. Controls (or any kind of class) can have events. A property is a special kind of a method on a class that you can use to implement get and/or set behaviour.
--Colin Mackay--
EuroCPian Spring 2004 Get Together[^]
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
|
|
|
|
|
I am trying to create a download program similar to flashget but I have come across a problem. Some of the files as you would know are retrieved by using ftp and others http. I have had no problem to download either of these but I found some download links are http to start off with and then are redirected to ftp. Here is the code I am using for http downloads:
<br />
HttpWebRequest myHttpWebRequest = (HttpWebRequest)HttpWebRequest.Create(fullFileName);<br />
myHttpWebRequest.MaximumAutomaticRedirections=100;<br />
myHttpWebRequest.AllowAutoRedirect = true; <br />
HttpWebResponse myHttpWebResponse;<br />
myHttpWebResponse=(HttpWebResponse)myHttpWebRequest.GetResponse();<br />
myHttpWebResponse.Close();<br />
The problem is files such as http://download.com.com/redir?pid=8132587&merid=50220&mfgid=50220<ype=dl_dlnow&lop=link&edId=3&siteId=4&oId=3002-20-8132587&ontId=20&dlrs=1&destUrl=ftp%3A%2F%2Fftpx.download.com%2Fpub%2Fwin95%2Futilities%2Ffilecomp%2Fwinzip81.exe get redirected to ftp and therefor cause a System.Net.WebException with the following message: "Cannot handle redirect from http/https protocols to other dissimilar ones.". This is understandable, but how do I go about redirecting the http download to ftp. I could do it easily if I were to get the ftp address. It is in the actual url above but in many other cases it won't be part of the url so could someone please help me out in solving this problem?
|
|
|
|
|
Hi,
I'm looking for a starting point here. I want to 'intercept' incoming HTML on the client, before it's handled by the browser. Is this possible?
Kind regards ,
Ludwig
|
|
|
|
|
One way to do it is to write a Browser Helper Object[^]. Browser Helper Object can then send message and pass URL to your main application.
|
|
|
|
|
Thanks for the answer. My initial idea was to have an independent application that runs in the system tray. But I need to go low level for this, I guess
|
|
|
|
|
|
Hi,
that class can be used if I set up a connection from within my application. But I need to intercept data from the browser itself, not from within my application....
|
|
|
|
|
Hi All,
I want to write an application, which searches the pdf files based on some keywords. All the pdf files which contains the keywords should be listed.If we double click one of the entries, it should open the pdf in a seperate window( all the keywords should be highlighted). Any idea ?
Thanks for your time
Mahesh Varma
|
|
|
|
|
I 's trying to do one of my school project and I 've a textbox which has multilines true and I was assigning string to the lines[] property. While assigning I 'm getting the error I listed below this program.
Would anybody please help me because I 'm new to this language?
I ' would really appreciate.
Thanks.
Gurvinder
private void cmdSelect_Click(object sender, System.EventArgs e)
{
// string seperated by colons ';'
string info;
info = txtTypeCommand.Text;
string[] GetInput = new string[4];
// define which character is seperating fields
char[] splitter = {','};
int Intval;
GetInput = info.Split(splitter);
if (GetInput.Length > 2)
{
MessageBox.Show("Only '1' Comma is allowed");
return;
}
for(int i = 0; i < GetInput.Length; i++)
{
if(i==0)
cmdArray[RowCommand,i] = Convert.ToInt32(GetInput[i]);
else
cmdArray[RowCommand,i] = Convert.ToInt32(GetInput[i]);
}
txtShowCommand.Lines[RowCommand] = info;
RowCommand += 1;
}
Error!!!
I 'm getting error an Unhandled exception has occured in your application.
Index was outside the bound of the array
|
|
|
|
|
The first thing you should definitely do is figure out exactly which line is causing this exception to be thrown. Debug it and step thru it. Figure out exactly which line is throwing the exception. You could also catch the exception and inspect it inside the catch block (the Exception class contains a full stack trace in it that will tell you exactly which line threw the exception).
I'm almost positive it's the lines that say:
cmdArray[RowCommand,i] = Convert.ToInt32(GetInput[i]);
This appears to be the only place you could get an array out of bounds exception, because the GetInput array will be properly initialized by the Split command (and you're going from 0 to its length, which is perfectly legal). Is this cmdArray set to the Textboxes lines? If you don't know how big he array's going to be, consider using a collection of some sort that will allow you to add things at will.
One other comment...
The array creation in this line:
string [] GetInput = new string[4];
is pretty much not needed. The Split command will return an array, so you could just say:
string [] GetInput;
and let the Split command assign however big the actual array is. There's nothing special basically about initializing it to an array of 4 strings since it will be recreated when you do the Split.
That's about all I can help without seeing the rest of the code, but that should give you a good place to start looking.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Generally very good advice. But there is another line that could cause the error:
txtShowCommand.Lines[RowCommand] = info;
--Colin Mackay--
EuroCPian Spring 2004 Get Together[^]
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
|
|
|
|