Answer Questions
Jasonlkk Question about objects behavior
I have a Class called animation. This Animation has a member of type Bitmap. It also has an arraylist member that holds objects of Frame type. When creating a frame object, a parameter of the constructor is the bitmap which is passed in as the Bitmap object that is part of the Animation class. Some operations need to be done on the Bitmap for the entire animation and thus these are performed by the Animation class. ...Show All
lamaslany valid date
Is there any method for validating the date that Date is in correct format or not DateTime.TryParse() Cheers, Greg Use the DateTime.TryParse method when you are using .NET 2.x; otherwise you can use something like Regex to validate the string or try-parse yourself by catching an FormatException of the DateTime.Parse method. ...Show All
Dazzl FileStream and writing out in chunks
hi all, i have a byteArray i read into from a httpposted file, i would like to write it to a new filestream in chunks of a size i specify. I can write the file out no problem at once, using myFileStream.Write(byteArray,0,postedFile.Length) but i want to break it up into chunks so that it stores smaller amounts at a time and doesn't kill the aspnet_wp. i have tried FileStream newFile = new FileStream(fullSavePath + sFilename, FileMode.Creat ...Show All
Yole how do i change the font color of a String.SubString in a textBox?
for example txtBox.text = "The color is green"; i want to display the word green as "green". is there a way to do that i got the change color part, here's what i have: this .txt.Select(start, len); this .txt.SelectionColor = Color .Green; now my problem is how can i highlight or select multiple substrings from txt.Text You can't do this in the TextBox control, only in the RichTextBox control. Us ...Show All
simonw. Timeout expired in SqlCommand.ExecuteNonQuery (insert) for SQL Server 2005
Hi, I am upgrading from VS2000 & SQL Server 2000 to VS2005 & SQL Server 2005. One of my massive programs has an exception after a lot of inserts to a certain table during insert via SqlCommand.ExecuteNonQuery: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. trace: at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnectio ...Show All
grikgal sending a message from one thread to another !!
Greetings... I know it's an incredibly simple question but in C# i just can't find how to do it... And the MSDN help system is giving a lot of information about everyting ...except the simple topic for which i need info on. I have a main window that launches worker threads and i need to know when they finish their jobs... In addition to knowing when a working thread finishes, it must be capable of receiving some completion value ...Show All
Chippen c# and Windows startup
How to start a c# application when windows starts up. Willfin David You could create the c# app as a windows service: http://msdn.microsoft.com/library/default.asp url=/library/en-us/vbcon/html/vbconintroductiontontserviceapplications.asp You can add a key to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\ or for user only HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentV ...Show All
Yutong MSFT Operator + in strings
string path = "C:\\Documents and Settings\\"+ LogonName +"\\Recent"; Error 1 Operator '+' cannot be applied to operands of type 'string' and 'method group' What do i have to do Thanks, Guilherme The code you've pasted above hasn't got any of the suggestions made above myself and Keith, that's why it's not working. Also you don't want to hard code the Documents and Settings folder ...Show All
sacherel Merging namespaces as one
Is it possible to merge multiple namespaces as one The reason I want to do this is because I want to inherit someone elses control, but use my own namespace. Using my own namespace stops the UI design tools from working. What I need is to be able to make C# think my control exists within the other name space, while still existing in my namespace. Maybe I'm asking for to much. I was hoping to keep it unchanged ...Show All
theperfectbeat radio button's "selected" event
am using 2 radio buttons in my form. rAdmin and rDesigner. < input type =radio id =rDesigner runat =server name =userType onserverchange ="rDesigner_ServerChange"> < input type =radio id =rAdmin runat =server name =userType onserverchange ="rAdmin_ServerChange"> when the user selects either radiobuttons, data is displayed based on which radio button is selected. where should i write the code for d ...Show All
anomolous How to change LinearGradientBrush with location (performance optimizations)
Hi , I have a graphics application which draws thousands of rectangles(or paths) on the screen at different locations. Each rectangle uses a LinearGradientBrush to draw itself. I am forced to create one brush for each rectangle because if I use a brush created for one rectangle, at a different location it does not draw properly, even when both rectangles are of the same size. I tried creating/destroying the brushes in my Draw routine but ...Show All
Tom Wing Running programs from a windows service
Is is possible to start a program from a windows service so the user can interact with it I am working on a service that accepts commands over a socket, and one of the commands I want to implement is to start certain software in a user account. Is there any way to accomplish this Thank You, Your service will have to have it's "Interact with desktop" flag set in the Services control panel. Can you do this programaticly ...Show All
Stefan Kratzert Aborting and Managing Threads: The Dog or the Cat?
Newbie here .... thanks in advance for your patience. I'm working w/ C# Visual Studio 2005 I've read up on all the comments about problems w/ aborting and suspending/resuming threads. Lots of things to consider. Looks kinda ugly on all fronts. Note that I'm not thinking of using suspend and resume to synchronize threads. I would like to just pause and then restart a particular thread from where it left off. Wo ...Show All
Cheng Du Creating objects at runtime
Ok. On the menustrip, I have a control called "new doc". I want when the user clicks that control to creat 3 tab controls, with a richtextbox in tabcontrol1, and a web browser in tabcontrol3. Any suggestions Form controls are classes just like any other. You create them with the new keyword. Once the control is instantiated, set the appropriate properties (location, size, text, etc.) and add it to the form's Controls collection: // form- ...Show All
Orellang Database Connection String
I am new to C# and VS2005 and am creating a large project which connects to SQL Server using numerous table adapters. I would like to be able to organize my code so that when I am building the project in Debug mode the table adapters use a given connection string. Then when I'm building in Release mode, the table adapters use a different connection string. I am looking for solution that only takes a few lines of code. I am ...Show All
