|
thanks for reply
but my problem was not solved.
i call ProgressChanged event handler manually, and solve problem :
private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e)<br />
{ <br />
int i = 0;<br />
while (i < 1000)<br />
{<br />
this.backgroundWorker1_ProgressChanged(null, new ProgressChangedEventArgs(i,i));<br />
i++;<br />
}<br />
}
but why it does not raise ?
thanks
|
|
|
|
|
this.backgroundWorker1.ReportProgress(i);
you shuld be using this to report progress as this will raise the ProgressChanged event which will inturn invoke the method refered to by the delegate given at the top (when u did something like
w.ProgressChanged += new ProgressChangedEventHandler(w_ProgressChanged);
)
rest of the logic is upto u but tryin this
hdv212 wrote: this.backgroundWorker1_ProgressChanged(null, new ProgressChangedEventArgs(i,i));
is simply meaningless
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
Do you have ProgressChanged event handler setup, e.g. backgroundWorker1.ProgressChanged += .... ?
Another thing to remember is that ReportProgress will call your handler asynchronously; it won't block the background thread.
|
|
|
|
|
hi all,
this may be a silly question but i'd like to know if there exists a solution or not.
the question is: i have 2 different applications (each contains just 1 form and both have their TopMost property set TRUE)
both work great (remain on top of all open applications) separately.
but if i start them one after another, the latter remains on top of all unless i don't click to the former on status bar.
i wonder if i am able to set priority between such forms ?
let's assume app1 and app2 and both have topmost property true.
but i'd like to have app1 that has higher priority than app2 or vice versa ?
thanks in advance.
bye.
MFA
|
|
|
|
|
ohh jeez that's a difficult one mate
I think u can't set any priority but may be there's some guru out there who can do such a thing but to me it looks quite difficult if not impossible
Rocky
Success is a ladder which you can't climb with your hands in your pockets.
|
|
|
|
|
Don't use TopMost, it's user hostile.
|
|
|
|
|
Hi! I'm making a program in C# but have some trouble.
I want to use marquee control, but .Net doesn't provide marquee control.
I've searched for that, but I found some commercial controls or broken download link to free control - "Marquee Label .Net Component 1.0" by Ning Zhao.
Is there anyone who has "Marquee Label .Net Component 1.0" or something like that?
Thank you for any help.
|
|
|
|
|
Hi,
you can use marque in aspx page.
Its working fine, you will get red line (error underline) but it will work.
<marquee>Hello World!</marquee><br />
Thanks,
Sun Rays
To get something you must have to try once.
My Articles
|
|
|
|
|
Sun Rays ou can use marque in aspx page.
Looks like OP is asking for windows applications.
|
|
|
|
|
Use a timer and move the label. It will look like a marquee.
|
|
|
|
|
|
Just make a custom control to do it for you. Not that tough.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi,
Im using C# and MS Access,
I was wondering if someone could tell me how to store an object of a class into the database, with an sql query.
My class is variable length so i cant separate its members into columns.
class Item
{
string name;
int id;
ArrayList values = new ArrayList();
}
Item i;
I need to sstore an object 'i' into the database.. can anyone help me?
I tried to find out a way to serialize, because i've done it before in php, just wondering if it can be done in that way in c#. If theres another way, do let me know about it..
Thanks,
Carl
|
|
|
|
|
You can convert an instance of Item class to byte array and store it in database in blob field
|
|
|
|
|
hi.. i tried to do this with th ebinary formatter, but it gives an error
Type 'Billing_Module.Bill' in Assembly 'Billing Module, Version=1.0.2924.30808, Culture=neutral, PublicKeyToken=null' is not marked as serializable.
MemoryStream fs = new MemoryStream();
BinaryFormatter formatter = new BinaryFormatter();
formatter.Serialize(fs, (object)newBill);
fs.Close();
aConnection = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source="+path);
string queryCommand= "insert into BillHistory values ("+newBill.billNumber.ToString()+","+fs.ToString()+")";
can someone help me?
|
|
|
|
|
You can make your class serializable by applying Serializable[^] Attribute
|
|
|
|
|
i want to sort the DataGridView...
i dont want to sort first row of the DataGridView.. i just want to sort only from the second row..
whenever i click the header the DataGridview should get sorted only from the second row, the first row should not get sorted
|
|
|
|
|
I created a system tray icon & attach Context menu to it,
Now on this i am opening some forms.
Suppose there is menu item "Open" & it opens a form,
now when form is opened & if user click again on "Open" it opens
again, i.e it doesnot focus the same opened one, instead open new instance.
So, How to rectify this.
what if i used mnuItem.checked property to solve the problem?
And plz tell me other ways to do this, if this is one
Thanks in advance to all.
|
|
|
|
|
You need to keep the forms object somewhere, and check it's IsDisposed property before creating new Form instance. If it is not Disposed, use BringToFront() to give focus to that form. If it is disposed, create new instance and store it.
|
|
|
|
|
N a v a n e e t h wrote: check it's IsDisposed property
I think(not sure) dispose method handle this part, or when we closes the form it get called?
a) Now how can i ues this property?
Do i have to use the click event of menuItem.
N a v a n e e t h wrote: You need to keep the forms object somewhere
b) Not clear?. what do u mean by this, as i am creating object of form, on the context menu form. How i keep the form object somwhere?
c) What about the checked property?
|
|
|
|
|
humdumof wrote: or when we closes the form it get called?
When the form is closed, Disposed property will be set to true. If form is active, it will be false.
humdumof wrote: Not clear?. what do u mean by this, as i am creating object of form, on the context menu form. How i keep the form object somwhere?
Declare an ArrayList instance as public in the class. In the context menu click, check ArrayList has any form instances. If yes check it's IsDisposed property. If it's disposed, created new instance and add that to array list. If not disposed, cast it to form and call BringToFront() method.
Hope it helps.
|
|
|
|
|
You could try using mutex to check if an instance of the program is already open or not..
Sorry i cant help you too much with mutex, however google and msdn have a lot of articles about it.
|
|
|
|
|
Use ShowDialog() instead of Show()
Becoming Programmer...
|
|
|
|
|
hi
My aim is to delete a paricular array element and sort it
example
int[] array1 = new int[5];
array1[0] = 1;
array1[1] = 2;
array1[2] = 3;
array1[3] = 4;
array1[4] = 5;
now i want to delete the array[2] element and bring the array it the order
1245
plz tell me how to do this
regards
sindhu tiwari
Always Innovative
|
|
|
|
|
Why don't you use an ArrayList ?
|
|
|
|