|
if(InvokeRequired)
{
Invoke(blah)
return;
}
lblStatus.text = "I like Crazy frog";
betonglasermur.FeedDwarf(pur_is, 17);
ProcessStartupInfo.AintNotCreateNoWindow = (false && !true) != (true || false) ? false == true ? true : false : (true != false && false);
Morgonen är tröttmans mecka
|
|
|
|
|
mehrdadc48 wrote: I make public some controls on the form
This is always a bad idea.
mehrdadc48 wrote: send this (current instance of the form) to that class as parameter of constrauctor.
How very ugly
mehrdadc48 wrote: How can I do this?
Use delegates to call a form and tell it to change it's UI elements. You can then either set things up to invoke the UI changes, when in another thread, or if you prefer nasty solutions, you can just turn off the cross thread operations error.
If you read the article I link to in my sig, and pay particular attention to the section on how to google error messages.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: you can just turn off the cross thread operations error
I wondered about this.
I've always avaoided doing this, and used delegates, as is is seen as bad programming practice by some.
However if I know(due to the design on the application) that a cross thread call will not cause a conflict is it okay to turn off the error?
You always pass failure on the way to success.
|
|
|
|
|
I'd say that's entirely up to the conscience of the individual. If you're OK with it, then why not ? I've done it, when I ported a C# 1.1 app to 2.0 and found that a progress bar that showed loading progress from another thread was not working and I just needed a quick fix. The code had run fine for a long, long time, and it was the first time I'd seen the error.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
//Declare Delegate :
private delegate void RefToFunction(string s);
//create an instanse :
RefToFunction handle = new RefToFunction(Function_A);
//Define the function :
private static void Function_A(string s)
{
lblStatus.Text = s;
}
//Invoke The Delegate (From where u need):
string status = "Hello World";
object [] param = { status };
this.Invoke(handle, param );
and thats it all
Have Fun
Never forget it
|
|
|
|
|
Hi,
is there anyway I can get a listview to scroll when either the mouse is scrolled or the scroll bar is dragged?
I have created a custom listview control by overriding WndProc()
-
Roger
|
|
|
|
|
You can handle the mouse wheel scroll event and scroll your listview
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Chris,Hi there,
I am having troubling with doing that itself. I can find Mouse_Up, Down, Capture click et all, but i need something like a mouse scroll for the listview control. How can i do it?
Would be doubly grateful if you could show me how!
-
Thanking you in advance,
Roger
|
|
|
|
|
Pathetic Logic wrote: Would be doubly grateful if you could show me how!
Hi,
Read This..[^]
Som
|
|
|
|
|
read what? it redirects me to my threads on MSDN!
|
|
|
|
|
As far as I can see, you need to handle the mouse wheel event, then set the scroll position in code, or did I misunderstand the question ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
yes. i need to handle and position the scroll bars according to the mouse move
|
|
|
|
|
hi
I want to know how to insert a image into a crystal reports Dynamically ?
Thank You
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
Image comes from the data base.
suppose when i select the Employee name based on that employee Image will be displayed. is it correct ?
Tell me clearly.
are you using Database Fields for Crystal Report field design and Typed DataSet as a Source.
|
|
|
|
|
thanks for the response i want user to select a image from his machine and it must get bind to the picture control on the crystal report
Thank You
Dont Get Paid for the Hours you worked, Get Paid for the Work You Have Done in an Hour.
|
|
|
|
|
Hi all i am working on some outlook addin that is used to move the mail in to specific folder
i am looping for each mail for a specific folder like
foreach (object mail1 in oFolder.Items)// here oFolder is the source folder...
{
// calling some Asynchoronous type function
// and based on the date and time condition am moving the mail to other folder
}
now what is happening it is moving only half of the mail to the destination folder .....
can anybody help me here what is the exact problem...
thanks alot...
vikas da
|
|
|
|
|
Hello Everyone,
i have made an crystal report application .I have three queries
1)In report footer ,i have total of previous pages separated by "," in sting variable i.e
string total:="200,300,400,500";
i want to split this and show in report footer like this
subtotal of page 1:=200
subtotal of page 2:=300
subtotal of page 3:=400
subtotal of page 4:=500
--------------------------------------
GrandTotal:=1400
---------------------------------------
please tell me how to do this?its urgent.
2)Secondly,the report footer is shown before page footer.
Is it possible to show pagefooter before report footer?
3)I want to add a page after report footer section.i hv set report footer section's property NEW Page After :=true.
but it doesnt work.
Is their any way to do this?
waiting 4 reply,
Thanx.
Manpreet Sadana
|
|
|
|
|
i want to take printout throught DMP directly from database to LPt
I want know the print code to print directly to LPT
will anybody give me code to print directly to LPT ?
thank in advance
help as a alias.
Be happy and make others happy.Cheer up...........
|
|
|
|
|
hello,
i'm trying to make the display of the group-box 3D and bold from the form
how do I do that?
|
|
|
|
|
Hello,
If I understand correctly, you wish to change the look of the GroupBox to 3D and
the Text portion to Bold using code.
3D style option is not available for GroupBox.
To make the GroupBox text bold, you can use the following code.
Font gfont = new Font(this.groupBox1.Font,FontStyle.Bold);<br />
this.groupBox1.Font= gfont;
I hope this will help.
Regards,
Allen
Allen Smith
Software Engineer
ComponentOne LLC
www.componentone.com
|
|
|
|
|
Is it true that using timers in Windows Services is not a good idea and the timers are unreliable for practical purposes since they stop firing the service after some time??
Som
|
|
|
|
|
Are you trying to schedule windows services ? Windows service is not built for that. Windows service either runs or sits in idle state. For scheduling, you may consider using inbuilt windows scheduler.
|
|
|
|
|
N a v a n e e t h wrote: Are you trying to schedule windows services ? Windows service is not built for that.
But I have seen many coding example on internet where they schedule Windows Services by timers.. I am doing the same..
Isnt it the right way??
By the way, I tried that idea, inserting a task in the windows scheduler..
But didnt succeed..
Windows Scheduler cannot run at specified intervals of time(say every two hours) in the same day.. But I need this functionality..
Also I didnt find any Windows API or any BCL method which inserts tasks into the windows scheduler programmaticaly..
Thats why using timers for Windows Services..
Can u suggest me what to do..
Som
|
|
|
|
|
novice1115 wrote: Isnt it the right way??
I don't think so. You can write a windows/console application which exits automatically after execution and add that to the windows scheduler.
|
|
|
|
|
N a v a n e e t h wrote: You can write a windows/console application which exits automatically after execution and add that to the windows scheduler.
So can you tell me how to add that console application to the windows scheduler task programmatically in C#?
Som
|
|
|
|