|
Have a look at something called VirtualMode, when this is enabled it will only draw those items which are currently displayed.
|
|
|
|
|
Hi guys.
i want to learn about Anonymous functions in C# 3.
Do you have any helpful links ?
Thank you .
|
|
|
|
|
|
Wow. Thank you very much Vuyiswa .
You're nice.
|
|
|
|
|
amGlad i helped you
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
hi,
i building a application and i use the usercontrol to fill up my form.
My aplication as 3 levels (login usercontrol -> menu usercontrol -> edit usercontrols).
I put the menu usercontrol inside login usercontrol, and other usercontrols inside the menu usercontrol.
I don´t know if this is good pratice, for me work but is messy.
I do this because it´s the only way i know to call the usercontrols since they are inside (and belong) to is parent.(i don´t want to trigger usercontrols from a form).
Other issue is the scrolls (vertical or horizontal), i get some problems since the contents go off limites and the scrolls don´t appear. I set scrolls in the usercontrols.
Code is just works fine,yet , is more a design issue
can anyone help me here???
|
|
|
|
|
Hi All,
How can i upload image to MYSQL USING C#.Plz HELP ME URGENT.Thanks in advance.
SHINOJ K
|
|
|
|
|
Do you know that Song with lyrcs that goes like
"Take time to know her" , i think the singer is Percy Sledge, am sure , but what saying yo you , infact not saying Singing
"Take time to Google,This one is easy"
http://www.google.co.za/search?hl=en&q=Insert+image+to+mysql+using+c%23&btnG=Google+Search&meta=[^]
hope it helps
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
How can I change the size of icons on the desktop to press a button?. For example, I want to change the size 48x48. I have searched without finding an answer.
Thanks in Advance
really appreciate your help.
|
|
|
|
|
You can get the size using SHGetFileInfo but I don't think it can be set. There's a registry setting that applies to some versions of windows but not all (not vista for example).
Dave
|
|
|
|
|
I am writing a code to test a COM object and one of its functions has an infinite loop.
Basically my code should run this COM object function in a different thread, give it some time to finish but if it doesn't, terminate it.
However, I encountered the following problems:
1) Thread.Abort wouldn't abort the thread because you can't use .NET Thread.Abort to abort unmanaged code.
2) AppDomain.Unload wouldn't do anything because it tries to abort all the threads.
3) I tried using Marashal.ReleaseComObject and it resulted with:
"An attempt has been made to free an RCW that is in use. The RCW is in use on the active thread or another thread. Attempting to free an in-use RCW can cause corruption or data loss."
By now the only current options I see is either using somehow the original Windows API to abort the thread or create a process especially to test the function. Both methods seem like a lot of overkill for what I'm trying to do.
Anyone has any ideas?
Vitaly Belman
|
|
|
|
|
One idea: Write an unmanaged wrapper around the COM object that will stop it and return an error code if it times out. So a call to this wrapped object will always return.
Another idea: Get the source to the COM object, fix the infinite loop, and recompile it.
Another idea: Characterize the cases that result in an infinite loop, and avoid calling the function when this would happen. (I like this idea best.)
|
|
|
|
|
Alan is right there, I'm afraid. There's just no way. You simply cannot kill a thread which is stuck in an unmanaged call. We had this problem too with DCOM calls not guaranteed to return, and had to learn that there is no way to get rid of the calling thread but to kill the process. Calling windows api to abort the thread is out of the question when you have a managed thread cause it will pull the api thread right away from under your managed thread's arse and lead to whatever results. So either you set up a complete process for testing, or you handle the testing within COM (but not in VB6, for lack of threading capabilities, but in C++ with ATL and all that void** stuff).
I don't envy you, if that's any consolation. As Alan said, the best bet would be to avoid all situations where the COM call can hang.
|
|
|
|
|
Hi there,
I have a simple user control that I would like to handle mouse events for (such as mouse down etc.). My user control has a couple of Panel objects on it, and these are receiving the mouse events I am interested in. I would like the parent user control to handle the events instead of the panel objects (or anything I insert onto the parent). I understand that I can assign the panel (and any other child object's) mouse event handlers to be the event handler I wrote for the parent, and that works as desired, but I'm wondering if there is a better solution?
So my question is: to have mouse events handled by a parent object, do I need to have each child object's event handler set to be the parent handler code, or is there a property I can set to automatically pass the event to the parent?
Many thanks.
- Dy
|
|
|
|
|
Hi,
I would try setting Control.Enabled=false; for those Controls that should not
react on keyboard and mouse. This would influence the rendering for some, not for Panel AFAIK.
|
|
|
|
|
That technique works well, thank you Luc.
As you said, it influences some controls paint jobs. Whilst that doesn't affect the control I'm working on at the moment, it probably will in the future, so I will continue to look for another means too.
- Dy
|
|
|
|
|
I've had this problem too when the question came up whether a control could give users a possibility to drag child controls around. Either you don't use controls at all and do everything in the OnPaint method (which is pure hell), or you have to suscribe to the mouse events of all child controls. So far I haven't come up with anything better than a central ChildControl_MouseDown handler and a call in the constructor (after InitializeComponent) like foreach (control in this Controls) control.MouseDown+=ChildControl_MouseDown
|
|
|
|
|
Hi,
I'm working to convert some java code to C#. I'm struggling to determine what is the equivalent C# statement to the Java "UnknownHostException". Can anyone point me in the right direction?
Regards,
Dave
|
|
|
|
|
As far as I know, there isn't an equivalent exception. If you need an exception of this specific type, you will need to derive it yourself from ApplicationException.
Scott Dorman Microsoft® MVP - Visual C# | MCPD
President - Tampa Bay IASA
[ Blog][ Articles][ Forum Guidelines] Hey, hey, hey. Don't be mean. We don't have to be mean because, remember, no matter where you go, there you are. - Buckaroo Banzai
|
|
|
|
|
just use ApplicationException as you are just advised
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I want to process something when keys.control and keys.left are pressed at the same time,so how do i know if them are pressed at the same time? Thanks!(C#)
|
|
|
|
|
Detect when the control key is pressed and released and store the status in a variable, so that when the left key gets pressed you can check if the control key is currently pressed.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Thanks for you reply!
I have solve my question.
code:
//Onkeydown
if(e.KeysData.tostring().contains("Control")&&(e.Keysdata.tostring().contains("Left"))
{
// do my work;
}
But i found a erratic thing:
if i press keys.left or Right/up/down,it ignore me in function OnKeyDown,OnKeyUp,OnKeyPress;
if i press keys.control and keys.left,it will process my work;
if i press keys.shift and keys.left,it will ignore me in function OnKeyDown,but process in OnkeyUp;
.....
i want to know when will those events occur?Could you help me?
|
|
|
|
|
Hi,
you can get the instantaneous value of the modifier keys using Control.ModifierKeys
so you don't have to track those keys yourself (which you can hardly do correct, say e.g.
the CTRL key gets pushed down on one Control, then released above another Form).
BTW: don't convert to string for a logical test; instead of
if(e.KeysData.tostring().contains("Control"))...
you can do:
if ((e.KeysData & Keys.Control)==Keys.Control)...
or
if ((e.KeysData & Keys.Control)!=0)...
|
|
|
|
|
Hi All,
I'm just looking at my class that builds a dynamic filter to be apply to a DataView. Originally the potential input to this class was predefined a ComboBox for this field, one for this field etc ...
However, I'm now looking at adding in some more complexity which may include an unknown number of certain ComboBoxes for a particular field. This is obviously adding in a lot of complexity to building the required filter string.
Is there a design pattern for this that I should be reading up on to make this class extendible and very dynamic??
Thanks in advance,
Jammer
Going where everyone here has gone before!
My Blog
|
|
|
|