|
I need a month year textbox or a monthyear selection control for an application in c# that displays only months and years and no date similiar to credit card expiry date style selection .Can anyone help from where can i get such a control or any alternative solution
|
|
|
|
|
Please, please, please don't post the same question to every forum on this site.
I answered this question on another forum earlier today.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am working on a desktop application (Windows based). It has a MDI form and a child form. At a time there will be maximum two child forms. Application has Wizard kind of structure, so has multiple steps.
Some of the times when user working on the application, it
stops responding to any click event though it shows the focus. User can click only on title bar and that works, all other control including menu bar, toolbar does not respond to click. In addition, I noticed there is one extra window you can see when you press Alt+TAB. The name of the window is WindowsFormsParkingWindow. Whenever this window is there, this problem arises.
Can anyone assist how to get rid of this problem
I able to figureout that it happenes when a control which does not have parent and get placed on WindowsFormsParkingWindow and have focus.
|
|
|
|
|
Controls by default are associated with WindowsFormsParkingWindow before they are part of control collection.
This problem occur when the control which is there in WindowsFormsParkingWindow have focus.
http://dotnet.org.za/johannds/archive/2004/03/08/650.aspx
- ashish
|
|
|
|
|
I've write a button base class. In the click even't i put code below:
this.Enabled = false;
this.Clicked(); //is a public virtual method in the class.
this.Enabled = true;
So next time when i when i use the button control i just need to put all my code in the Clicked() method in the custom button control. But the proplem is how do i put the in the Clicked() method ? In VFP i just need to override the Clicked() method with mu on code. But in C# it seen like quit confusing for me. Please advice. Thanks.
Below is the complete class code.
public class stdTextBox:System.Windows.Forms.Button<br />
{<br />
protected override void OnClick(EventArgs e)<br />
{<br />
this.Enabled = false;<br />
this.clicked();<br />
this.Enabled = true;<br />
}<br />
private void clicked()<br />
{<br />
}<br />
}<br />
|
|
|
|
|
What is VFP ?
Clicked is not a method, it's an event. You need to add an OnClicked handler, either by overriding the method, or writing a handler and adding it to the Click method.
Here[^] is some info on the topic.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
VFP = Visual FoxPro. Thanks you very much.
|
|
|
|
|
Hy!
My DragDrop event doesn't work, but the DragEnter and DragLeave events work OK.
I've added EventHandlers to the events. I tried debuging, and i saw that the DragDrop event wasn't called.
What can causes it?
|
|
|
|
|
|
Hi all,
if anyone can help me it would be greatly appreciated...
I created an Excel model in my C# code and now need to send it to the client (on a button click) for download (with the standard Open, Save, Cancel dialog box)
I could save it to the server first as an .xls file and then send it as a file to the client but I would prefer not to do this since the actual file is not even needed on the server side
schoudhr@hotmail.com
|
|
|
|
|
I can find a million tutorials on converting XML to RTF but can you point me to a link that will show me how to convert RTF to XML in C#.Net?????
Mike Mac
|
|
|
|
|
How would that work ? Where does the schema come from ? How do you know what goes in each node ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
It may use its internal schema. All we want is the conversion program/script should map rtf tags to corresponding xml ones. Request someone guide us through this.
Thanks in advance,
Sandy (sandeepsahane@gmail.com)
|
|
|
|
|
i have a 300x300 png with some area transparent and i need another one 500x600 also this with some transparent area.
i need to draw in a 200x200 picture box a rect(200x200) of the first one on the picturebox and over this a rect of the second one (200x200).
It could leave transparent areas if found.
How could i do?
|
|
|
|
|
A picture box only shows one image, I suspect you need to merge them first. I'm not sure if you can do this with transparency, but I'd hope so.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I would like to write a console application in C# that allows for me to login to a website that requires a username and password. Additionally, I would like for the program to automatically store and manage my cookie(s) for the given website as well. The site that I have attempted to test this this on is listed below.
http://www.homeseekers.com/
user:test
pass:test
I have been following the examples I found on this site http://west-wind.com/presentations/dotnetWebRequest/dotnetWebRequest.htm with no luck. Could you tell me where exactly I am going astray? Or perhaps point me to some resource(s) that might clear up the confusion?
-TIA Dirk
ex.
try
{
string lcUrl = "http://www.homeseekers.com/Scripts/my_login.asp";
HttpWebRequest loHttp = (HttpWebRequest) WebRequest.Create(lcUrl);
loHttp.CookieContainer = new CookieContainer();
//pulled this information from firefox live http headers program
string lcPostData = "myUserID=test&myPassword=test&Login=Log+in&blnFromLogin=True&PreviousPage=%2Fdefault.asp%3F_ver%3D5%26_lid%3D0&remember=1";
loHttp.Method="POST";
byte [] lbPostBuffer = System.Text.Encoding.GetEncoding(1252).GetBytes(lcPostData);
loHttp.ContentLength = lbPostBuffer.Length;
Stream loPostData = loHttp.GetRequestStream();
loPostData.Write(lbPostBuffer,0,lbPostBuffer.Length);
loPostData.Close();
HttpWebResponse loWebResponse = (HttpWebResponse) loHttp.GetResponse();
Encoding enc = System.Text.Encoding.GetEncoding(1252);
StreamReader loResponseStream = new StreamReader(loWebResponse.GetResponseStream(),enc);
string lcHtml = loResponseStream.ReadToEnd();
for(int i = 0; i < loHttp.Headers.Count - 1; i++)
{
Console.WriteLine(loHttp.Headers[i]);
}
loWebResponse.Close();
loResponseStream.Close();
}
catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
~Yes, I am some kind of idiot.~
|
|
|
|
|
Hi guys,
I've got a C# smart client application that allows the user to change, create, or delete data that's stored in an MSDE SQL database. I've rolled my own messaging queue so that the when a client updates lots of data at a time (e.g. deletes 500 rows of data, create 2 rows, update 100 rows), I send a batch message to my server application containing 602 sub-messages describing what happened (in other words, one big message containing all the actual messages describing what happened). This way I only have to go over the network from client to server only 1 time.
All that works great.
My problem is that now that the "delete 500, create 2, update 100" batch message is on the server, I have to call a stored procedure in the database for each message: call RemoveRow stored proc 500 times, call CreateRow stored proc 2 times, call UpdateRow stored proc 100 times.
Using a profiler to look at my code, it is apparent that this execution of several hundred stored proc calls is a bottleneck. Is there any way to allow the MSDE database to execute a batch of commands all at once? Or better yet, is there a better way of doing this?
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango
|
|
|
|
|
Hi am writing a chat server and I was stress testing my server and found some errors.
Say I have an arraylist.
ArrayList sockets = new ArrayList(listOfSockets);
Now I call Socket.Select to take out the sockets that don't have data on them.
Socket.Select(sockets, null, null, 100000000);
This is where the error happens, if I pass in a ArrayList that has 65 sockets in it.
It causes a IndexOutOfRangeException to happen. I have tried using other ways of doing it and it causes different errors but it always happens when it reaches 65 sockets.
I am dumbfounded please help.
------------------
I'm naked under my clothes...
|
|
|
|
|
That's badass how your name scrolls!!! Can you teach me your hax0rz skillzE?@!??
/\ |_ E X E GG
|
|
|
|
|
Hello everyone,
I'm working on imaging software in C#, but there's problem with memory.
For example, when I load thumbnail images to album or a sigle image in full size, task manager will show that memory usage of my app has grown from 20 MB to 170 MB or more! What's worse, when I close the MDI form album with thumbnails, usage doesn't go down till closing the whole app.
I thought that Garbage Collector should remove all resources, but it's quite inactive... When I force thumbnail image to dispose (calling Image.Dispose()), nothing change.
I have a suspicion that memory usage of my app growing gradually till some moment when system tells user there is not enough virtual memory.
I'm afraid that times of malloc() and free() are gone, but...
|
|
|
|
|
ltinka wrote:
I thought that Garbage Collector should remove all resources, but it's quite inactive... When I force thumbnail image to dispose (calling Image.Dispose()), nothing change.
You are right that GC doesn't do anything. GC is very lazy. Because of performance it basically collects memory when there isn't enough free memory, or when you tell it to do so (calling GC.Collect() ) Here[^] is a lot information about GC.
Task manager shows memory allocated for a process, and this is actually bigger than memory used. IIRC that's what execution engine (I think) does - allocating is expansive operation, so it tries to minimalize allocation (by allocation bigger blocks of memory at once).
ltinka wrote:
When I force thumbnail image to dispose (calling Image.Dispose()), nothing change.
You should always do that. Exactly for very reason how GC works.
David
|
|
|
|
|
Firstly, make sure you don't have any references to your images: if there are still references to the images in memory, the garbage collector will not collect the in-memory images.
Finally, as a way to determine if your images are being cleaned up, try calling
System.GC.Collect();
System.GC.WaitForPendingFinalizers();
And the garbage collection will kick into action and reclaim unused memory. If your memory is still high, you've got some references to the images still hanging around.
Also, when you're done with an image, call Dispose() on it. It'll free up some resources immediately before the GC ever gets around to reclaiming the memory.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Conversation With a Muslim
Judah Himango
|
|
|
|
|
dhn is partially correct. The GC is pretty lazy, but not as bad as he makes it sound. The GC Scheduler makes it's own determinations on when to run the GC process. MANY factors cause the Scheduler to either slow down the schedule or speed it up.
It doesn't run only when your running out of memory. For instance, if you suddenly dispose of a large number of objects, then the GC will kick in early to clean up and compact memory. If you only disposed a few large objects, the GC won't collect them until it's normal schedule.
Basically, looking at the Task Manager is not a good indicator of how much memory your application is actually using. What your seeing is appoxmiately how much unmanaged memory is allocated to your processes managed memory heaps, whether your using it or not. In other words, this is NOT a representation of how much unmanaged memory your application is actually using. The .NET Framework Memory Manager is also responsible for returning managed memory back to the unmanaged pool, if and when needed, or if requested by the system.
If you want to check to see how much memory check into using the Performance Monitor. For instance, according to the Task Manage, a little analog clock application that I wrote is currently occupying 13MB of Memory. The Performance Monitor says that it's more like 178KB.
Don't worry about it. The GC will collect on schedule and when it needs to. Any managed memory that needs to be released back to the system for other processes will be freed. It's just a matter of time and necessity.
Oh! BTW: Forcing the GC to collect is not a good idea unless you know exactly what your doing and why. Forcing collections will mess with the Scheduler's optimizer and can actually hurt your applications performance.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
dhn is partially correct. The GC is pretty lazy, but not as bad as he makes it sound.
Everything I say sounds bad these days cuz I feel like that. That is, bad. Yeah I was quite incorrect. Thanks. OTOH I belive he follows that link I gave him... so he can correct my mystifications
David
|
|
|
|
|
Make sure you dispose of absolultey every thing the moment you have writen it to the screen.
If you write a bitmap to screen... dispose of it.
if you draw a line dispose of the pen and/or brush and the graphics object as soon as you have drawn it.
Dont think because its on screen you should not dispose of it until you no longer need it on screen... draw it then dispose of every graphics element(Bitmaps, clones, pens, brushes, graphics objects) it used.
I wrote a simple app that used cloned portions of a bitmap as brushes and painted them to the screen... i didnt get many brushstokes done before i hit an "Out of memmory" error when depending soley on the GC.
|
|
|
|