|
In such cases you must create custom control with owner draw.
My english is not so good. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
I tried to this
I did my own button class that derived from class button and changed its behavior using setStyle Method to enable double buffering and user paint and allPaintingInWMpaint, I did all of this in the constructor of my class but I didn’t overrides the OnPaint Method
And still got the problem
If u don’t mind, can u give me what u advised me in a sample code?
Thx
|
|
|
|
|
I think he meant something different. Instead of creating x separate controls implement on user control which paints all buttons together and also handles the mouse events etc for himself.
ControlPaint.DrawButton will help you doing this.
|
|
|
|
|
Maybe its a system resource issue. I have seen window draw controls individual after heaving thrashing so it is a possibility. 50 buttons could be considered a lot on some systems.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
|
Build the exe of the application and execute it.
Pramod
|
|
|
|
|
Many Thx
Yes this works for release version and run in good state from outside the IDE
|
|
|
|
|
When we have to use arraylist & hashtable?
Mallikarjun
|
|
|
|
|
|
Hi all
I need to declare and initialize the object for another class inside the present class. and how to add tht statement to my existing class using CodeDOM
Thanking you
Mani
-- modified at 6:55 Wednesday 19th July, 2006
|
|
|
|
|
Hi. I have created a thread that calls Thread.Sleep(60000) after doing some work, and then it does some more work.
What I wanted to do is to make the thread to resume processing and not having to wait the 60000ms until the sleep ends.
For example, a function that tests if the thread is asleep, and if so, wakes it up. Is there a way to do this? I tried with the 'Resume' function, but this works only if the thread is in 'suspended' state.
Thanks.
|
|
|
|
|
Try to "Suspend" thread insted of "Sleep".
My english is not so good. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
Thanks for the advice, but Suspend just suspends the thread infinitely.
The normal behaviour of the thread should be:
DoSomeWork
Thread.Sleep(60000)
DoSomeMoreWork
But in certain occasions I need to tell the thread to execute 'DoSomeMoreWork' before the sleep ends, that is, tell it to stop sleeping and continue execution.
|
|
|
|
|
Just put it in another thread instead of in main thread. Use some flag, for example "isFinished" or something like that.
DoSomeWork
while(isFinished == false)
{
... waiting...
}
DoSomeMoreWork
|
|
|
|
|
Use timer to manage this situation.
My english is not so good. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
Use .net synchronisation mechanism . If u want ur worker thread to wait for a specific event use wait handles for the same. It is recomended not to use sleep to get the necessary syncronisation.
|
|
|
|
|
Use one of the many synchronization objects that .NET provides. Take a look at AutoResetEvent[^], ManualResetEvent[^] and Mutex[^]. In all the cases, you would have to do something like
Thread A
--------
DoX();
syncObject.WaitOne();
DoY();
Thread B
--------
DoP();
syncObject.Release();
DoQ(); The advantage of using synchronization objects instead of looping with a flag is that threads waiting on a synchronization primitive do not consume CPU cycles. Windows knows about synchronization primitives and so doesn't schedule the thread for execution until the sync object is signalled. With looping, Windows is forced to schedule that thread and it uses up its time slice looping.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I´d like to write a Program in C#. But I need to integrate existing c++ classes. Principally this should be possible, but I´ve no Idea how to manage this.
Can anybody give me some hints how to start or can anybody give me a Link to a useful Tutorial?
Thanks a lot!
|
|
|
|
|
You can implement COM interfaces on your c++ classes, then import COM objects in C# and use it. Read C# books most of them tells how to work with COM. Also you need to read some C++ books on COM.
My english is not so good. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
I think this article could help you:
http://www.codeproject.com/useritems/usingcppdll.asp
|
|
|
|
|
the problem here is that (i) is a unsigned long long, and all the squar funktions i can find is only operating in duble or long duble....
I woud make one my selv, butt all the ways of calculating the squar of (i) i coud find uses some trial and error. is it not posserble to calculate theis wiith out a trial and error method, as i see this as a time theif.
a *.h file will be geat, but as i hope to go further than just unsigned long long, a way of calculating it woud be even better.
regards t
|
|
|
|
|
Why not do some converting?
ulong value = 4;
ulong sqrt = Convert.ToUInt64(Math.Sqrt(value));
|
|
|
|
|
Is an iterative method (trial and error) but it works and is fairly efficient.
A man said to the universe:
"Sir I exist!"
"However," replied the Universe, "The fact has not created in me A sense of obligation."
-- Stephen Crane
|
|
|
|
|
hi all,in my web application i provide the option for searching the records which are present in the database.Initially(a week after deploying ) this wont make any problem for me but the records in the database are now closer to 1000,and it loads slowly and take more time to display the result in the grid,i feel in future it will take more and more time to load,how to speedup my application while searching.
Regards,
ayyp
|
|
|
|
|
Hi ayyp,
You could make of custom paging in datagrid so that it fetches only what is required.There is a very good article on this on codeproject.Go thorough that and if you find any other method do inform me as I am also doing the same thing.Here is the article link http://www.codeproject.com/aspnet/PagingLarge.asp
|
|
|
|