|
Ah thank you, I see where my mistake is. form.Show() only works if you have Application.Run on another form.
ie:
new Form2("b").Show();<br />
Application.Run(new Form2("c"));
Thank you very much =]
|
|
|
|
|
Abydosgater wrote: form.Show() only works if you have Application.Run on another form.
Not quite.
new Form2("b").Show();
new Form2("c").Show();
Application.Run();
also works, but behaves slightly differently.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi guys, I'm trying to just update a progress bar in a simple app that downloads files.
The relevent code is as follows:
static void updateProgress(object sender, DownloadProgressChangedEventArgs e)
{
progress = e.ProgressPercentage;
}
static void finishedDownload(object sender, AsyncCompletedEventArgs e)
{
done = true;
progress = 0;
(sender as IDisposable).Dispose();
}
public void downloadFile(string url)
{
done = false;
progress = 0;
WebClient client = new WebClient();
try
{
client.DownloadFileCompleted += new AsyncCompletedEventHandler(finishedDownload);
client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(updateProgress);
Console.WriteLine("Before");
client.DownloadFileAsync(new Uri(url), Application.StartupPath + "\\temp.flv");
Console.WriteLine("After");
}
catch (Exception ex)
{
if (client != null)
client.Dispose();
done = true;
MessageBox.Show(ex.Message);
}
}
So the problem is that updateProgress() and finishedDownload() don't get called when client.DownloadFileAsync() completes and/or updates.
What am I doing wrong?
Thanks
-Fudge
|
|
|
|
|
Fudge Mutator wrote: client.DownloadFileCompleted += new AsyncCompletedEventHandler(finishedDownload); client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(updateProgress);
Theere is no event attached to DownloadFileAsync
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
Oh, forgot Form1.DoEvents() thanks!
|
|
|
|
|
Hi,
your code works for me. I added log statements to both event handlers, and got the file I asked for.
Nevertheless I would be inclined to make client a class member, so it cannot get collected as soon as downloadFile() returns.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi all,
I'm working in a project in which I need to import a text file containing a stream of comma delimited lines of data and convert it into a Microsoft Excel 2007 file in order to perform some queries on the Excel file and give some results.
When I wrote a code doing this, it took a very long execution time because the text file contains about 70,000 lines and I had to loop over all these lines, read each line, get the data in between the commas, then write it into the Excel file.
Then I knew that there is a built-in Microsoft Excel function called (Text to columns) in the (Data) menu which is doing the same job in a few seconds only.
The Question is : is there any way to import this Excel (Text to columns) function or use it into my C# code so that the user of my program doesn't have to open the text file in Microsoft Excel and convert the data into columns before using my program ?
Thanks.
|
|
|
|
|
hello sir ,
i am using a datagrid control in window form. my problem is that my data grid contain 24 columns. so is there any way i can disable scrolling for
first two columns.
|
|
|
|
|
DataGrid or DataGridView?
in a DGV the DataGridViewColumn.Frozen property should help you out.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
actually i am using datagrid
|
|
|
|
|
That is too bad, maybe you can switch to DGV?
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
hello,
can anybody tell me how to change font of tooltip control ? because my project display in other langauge. it is not English ...
|
|
|
|
|
You will need to have the tooltip text either in the resource files or database(whatever you are using) and set it from there. May be this will help you:
SetToolTip(controlName,textfromResourceFile)
जय हिंद
|
|
|
|
|
i have retriev that text from my database. but it still cannot show. just show ាសថសដថាសដថាសដ something like this. so how can i do next ?
|
|
|
|
|
I don't seem to understand your problem. Can you re-phrase?
जय हिंद
|
|
|
|
|
ok. i have a tooltip control. and i want to change it font to other language. and i don found this tooltip's font property. it alway show as "ាសដថាសដ" when mouse on. and i also follow ur step that get text from Database. but i still cannót show in other language else from English after i get into tooltip control. so do u kno how to do with it ?
|
|
|
|
|
Whats the problem with "ាសដថាសដ"? It does not looks English to me.
जय हिंद
|
|
|
|
|
ាកសដកថis kind of other langauge that i want to show in tooltip control. it isnot a English langauge. understand ? it is just a data that i retrieved from database as a step that u have told me.
|
|
|
|
|
If you have retrieved this text from database, just set this as the text for the tooltip. If it does not shows up correct, I think you need to look into encoding.
By the way, which language is this?
जय हिंद
|
|
|
|
|
it is cambodain langauge. call "khmer unicode" . where of encoding should i look for ?
|
|
|
|
|
May be this[^] link can help you. Not sure though.
जय हिंद
|
|
|
|
|
ok let me tell u again. that langauge can be shown in textbox. because i set that textbox font property. and Tooltip doesn't have font property. so it cannot be display this type of text. so do u know how to set a font property to tooltip control ?
|
|
|
|
|
Hi,
AFAIK you can't choose the font size, style or family.
However you can draw everything yourself any way you like, see this example.[^]
[ADDED] Balloon Tips Galore![^]
might interest you too.
[/ADDED]
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Just a thought, can you assign the tooltip text to a textbox and is it readable. I suspect your database may not support unicode.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hello all,
i am a newbie for c# and would like to know if it is correct way to do as below
public unsafe struct test
{
public long lTime;
public fixed char AlphaChar[2];
public fixed char Stamp[8];
public fixed char Stamp1[8];
public fixed char Stamp3[8];
public short tCode;
public short ECode;
public short MsgLength;
public fixed char MSGTEST[4];
}
now i am struck with filling data into this structure.
Jalsa
|
|
|
|