.net-3.5

How to set windows 7 like look of desktop application (c#.net)

my client is asking for windows 7 like look for my desktop application (developed in c#.net). please tell me how can i set such theame for my application so that i would look like windows 7... please tell me if any such a controls/theme available... (open source is prefered)... please help me out.. i am using .net framework 3.5... and i ...

How can I prevent a textbox from taking focus on the postback when I have a calendar extender on it?

Hello, I have repeater, inside this repeater is a user control. In my c# codebehind on my user control I dynamically add a textbox and assign a calendar extender to it. Similar to this. //custom control protected void Page_Load(object o, EventArgs e) { TextBox tb = new TextBox(); tb.ID = "myTextBox"; MaskedEditExtender meeD...

Alterning default Menu(Item) mouse reactions

I am making a customized menu, with customized menu Items. Changing control templates and styles have been oke, but now I would like to change the way mouse events effect the menuItems visibility. By default, when you click a MenuItem within the pop up of a parent menu item, the pop up will collapse. When the mouse leaves the pop up sta...

How do I convert the Cookies collection to a generic list? Easily

Anyone know how I can convert Request.Cookies into a List<HttpCookie>? The following didn't work as it throws an exception. List<HttpCookie> lstCookies = new List<HttpCookie>( Request.Cookies.Cast<HttpCookie>()); Exception: Unable to cast object of type 'System.String' to type 'System.Web.HttpCookie' ...

How to target multiple versions of .NET Framework from MSBuild?

I am improving the builds for an open source project which currently supports .NET Framework v2.0, v3.5, and now v4.0. Up until now, I've restricted myself to v2.0 to ensure compatibility, but with VS2010 I am interested in having real targeted builds. I'm looking for some guidance on how to edit the MSBuild csproj/sln to be able to cle...

C# - How to calculate the current day-of-year?

Today is 5.27.2010 - this means it is day 147 of this year. How do I calculate that today is 147 based on the current date? ...

C# Conditional Compilation and framework targets

There are a few minor places where code for my project may be able to be drastically improved if the target framework were a newer version. I'd like to be able to better leverage conditional compilation in C# to switch these as needed. Something like: #if NET40 using FooXX = Foo40; #elif NET35 using FooXX = Foo35; #else NET20 using Foo...

Weird Textbox tab issue in asp.net page using 3.5 framework

I have a crazy issue when tabbing from one textbox to another. This happens on a webpage which contains about 20+ textboxes, and this happens on the same textboxes, and I have no idea what is the cause. When the cursor is in a textfield, I type in a value, hit tab, the focus goes to the next textbox, I hit tab, the focus stays in the s...

Error:A generic error occurred in GDI+

I created a web project on the server, and when I upload an image shows me the error Error: A generic error occurred in GDI+ I have read many links on the net that talk about this issue, and although I made the changes, nothing went wrong. I was thinking if the case is not an issue of permissions to folders. In fact I have two fold...

Reasons for Parallel Extensions working slowly

I am trying to make my calculating application faster by using Parallel Extensions. I am new in it, so I have just replaced the main foreach loop with Parallel.ForEach. But calculating became more slow. What can be common reasons for decreasing performance of parallel extensions? Thanks ...

List<int> initialization in C# 3.5

I can initialize a List<int> like new List<int>{1,2,3,4,5}; However List<T> does not have a constructor which accepts a single parameter. So I tried to run this through the debugger and it seems to be calling the Add method. So how does the compiler know which method to invoke to add each individual element. This may be a silly question...

Sending E-Mail in C#

I’m using .NET 3.5, and I want to automatically send a mail. I’m currently using the following: Microsoft.Office.Interop.Outlook.MailItem mailMsg = (Microsoft.Office.Interop.Outlook.MailItem)outlookApplication.CreateItem( Microsoft.Office.Interop.Outlook.OlItemType.olMailItem); mailMsg.To = recipient; mailMsg.Subject = subjec...

WCF debugging on Windows 7 x64

I have created a very simple WCF sandbox project using Visual Studio 2008, consisting of: Console client application WCF Service Library, running in WcfSvcHost.exe I am unable to debug the WCF service on my Windows 7 x64 system. I get a popup saying: Unable to automatically debug 'ServiceLibrary'. The remote procedure could n...

Using microsoft report viewer with objects

Ive got some nested objects that I am trying to generate reports for. A BackupClient contains BackupVersions and BackupVersions contain BackupFiles. I passed in the list of BackupClients - and the report displays the client name, etc.... but to display the versions - It says I have to have a Binding Source for BackupVersions. If I pull a...

.Net 3.5 DLL XML dependency

Hi, I wrote a class library in C# that uses a external XML file to store some data. I use this data (encoded rules) directly in the class library to do some substitutions within a text parser. The rules within the XML: <rule> <word>h e l l o</word> <sub>Hello</sub> </rule> When I share the lib, I also have to share the XML. T...

Cannot create instance of 'Ribbon'

I'm having trouble using the Ribbon control from the Office 2007 RibbonControlsLibrary.dll. It works for most people but not for me. The fault I get is: Cannot create instance of 'Ribbon' defined in assembly 'RibbonControlsLibrary, Version=3.5.31016.1, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Exception has been thrown by the ...

What's exactly the nature of .Net Framework 3.5 Service Pack1?

Hello, I did some recovery disk operations with my laptop because it became instable. Now, I'm about to re-install SQL Server 2008 Professional, but it keeps telling me that I need to install .net framework 3.5 with service pack1. What's strange is I was asked to do the same when I installed Visual Studio 2008 Professional earlier. I...

How Do I Handle errors in Windows Applications

I did a program and in some point - when the program needs to exit he throw an exception here is the code try { Application.Run(new Form1()); } catch (ExitException) { } In the VS it's working fine (VS 2008 - C#) But when I run it separately from the VS - the program say so the error is not handled I know so I can do like this A...

How to loop through the ChartColorPalette properties and add to list?

I am using the Microsoft Chart Controls for .NET 3.5 (C#) and have a chart in a winform. My hope is to allow the user to change the color palette based on their preference. How do I iterate through the color properties of the ChartColorPalette and add them to a combobox list? I know it should be something like: for each(something in ...

How to read from an XmlReader without moving it forwards

hey guys, I've got this scenario: while (reader.Read()) { if (reader.NodeType == XmlNodeType.Element && reader.Name == itemElementName) { XElement item = null; try { item = XElement.ReadFrom(reader) as XElement; } catch (XmlException ex) { //log line number a...