.net

How to create F1 help in windows forms using c#

How do you create the keyboard shortcut(F1) in a windows form using c#. WinChm ...

Adding a dll file to a C# project

It's a beginners question, but... If you look at the image above, there is the "Bass.Net" dll added as reference and also directly as file in the project. Can someone tell me what's the point of doing that? ...

Is immutability useful on non parallel applications?

I like the immutability concept but sometimes I wonder, when an application isn't meant to be parallel, should one avoid making things immutable? When an application isn't multi-threaded, you aren't plagued by shared state problems, right? Or is immutability a concept like OOP that you either use all the way or not? Excluding the cases...

Is there a built-in way to convert IEnumerator to IEnumerable

Is there a built-in way to convert IEnumerator<T> to IEnumerable<T>? ...

handle a file upload from a html page to a separate .NET page

I want to upload a file from a web application. The web application calls web services to access .NET classes, but it's not a .NET application itself. What I want to do is this: upload a file from the web application, and call a separate .NET page to process and handle the uploaded file. It would be easy to do this if I used a php sc...

Visual Basic How do I read a CSV file and display the values in a datagrid?

I'm using VB 2005, how do I open a CSV file and read the columns/rows and display the values in a datagrid? CSV file example: jsmith,[email protected] I then want to perform an action on each row i.e. each user, how would I do this? I'm a newbie as you can tell but happy to learn. Thanks ...

.net GridView Control for online catalogue, will it work?

Hi, Trying to build an online catalog for a web shop. Is the GridView control configurable enough for this, i.e. each item, for example product picture, title, price, qty field, 'add' button, and then move right to the next one, basically a typical online shop layout, or is another control better suited to this layout type? I have prev...

coming from bash, what windows scripting language to learn?

For work I am moving over to windows after being on linux for quite a while. I want to get some scripting skills going for administrative tasks in windows. I am quite good with bash, but bash's "libraries/tools" are missing a lot when it comes to windows. I see vbscript, wsh, powershell, cmd, jscript, etc and wondering what to learn, or ...

Get VS to highlight all .Net 3.5 SP1 method calls.

There are a bunch of new APIs in .Net 3.5 SP1. Short of uninstalling .Net 3.5 SP1 (or doing dev on a VM), is there a way I can get VS 2008 to target .Net 3.5(RC) as opposed to .Net 3.5 SP1? Is there a way I can get it to issue a warning when there is an API not supported in 3.5 SP1 which is being invoked? Similar question: http://st...

How to handle exception thrown from Dispose?

Recently, I was researching some tricky bugs about object not disposed. I found some pattern in code. It is reported that some m_foo is not disposed, while it seems all instances of SomeClass has been disposed. public class SomeClass: IDisposable { void Dispose() { if (m_foo != null) { m_foo.Dispose(); ...

Is there a WmpBitmapDecoder equivelant in Silverlight?

Does anyone know how to use Windows Media Photo (.wdp) in silverlight? There is the WmpBitmapDecoder class for regular wpf applications, but I don't see anything like that when I create a silverlight application. Are there any alternative image formats that might be better or easier to use? ...

How can I replace an existing image on a winforms ImageList?

How can I replace an existing image on a winforms ImageList? I tried this: this.CoolPics.Images [ 2 ] = // new image this.ListViewControl.SmallImageList = this.CoolPics; However the new image is not rescaled the way the others are, when I used the this.CoolPics.Images.Add method. What am I doing wrong? ...

Can you just loop through the results of a .NET RIA services call in silverlight as if it were a list of POCO objects?

void myButton_Click(object sender, RoutedEventArgs e) { var oContext = new DomainService1(); var oResult = oContext.GetPersistMapSet(); oContext.LoadPersistMapSet(); foreach (PersistMap oMap in oResult.ToArray<PersistMap>()) MessageBox.Show(oMap.Data.ToString()); } http://screenc...

How to temporarily disable log4net logging for perf tests?

I have log4net loggers configured to run with my unit tests, but for a few select unit tests that serve as perf tests I want to disable logging. How can I disable (and later re-enable) logging at runtime, basically overriding the logger settings that are in my .config file? ...

Calculator keypress

i made a basic calculator. but i don't know how to assign keypress. how it assigned? ...

Using WPF (which requires STAThread) with an API that can't work with STAThread

I am writing a WPF application that has an optional dependency on an API that has a simple requirement; It MUST be initialized/used on a thread that does NOT have the STAThread attribute. Of course, WPF requires STA so that makes everything easy. In this case, WPF is required no matter what. This third party API is required only when th...

what is cross compiler and cross platform ?

I am bit confused with the terms of cross platform and cross compiler. Let me be first clear about the cross platform. When people talk about cross platform it means the architecture of the CPU, i.e, X86 and X64 ? or the OS i.e windows 32 bit or Windows 64 (server or desktop)? UNIX doesn't have different flavours like 64 bit or 32 bit. W...

Passing parameters to a template

Hi, Say I have defined a button with rounded corners. <Style x:Key="RoundButton" TargetType="Button"> <!-- bla bla --> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Border CornerRadius="0,5,5,0" /> <!-- bla bla --> </ControlTemplate> </Setter.Value> </Setter> </Style> I it pos...

How to prevent cross domain issues by proxying in IIS?

I have a site written in Delphi that needs to get data from a .NET web service. In order to consume the web service I am attaching to a .NET web site first that contains a wizard that the end user has to fill out, which in turn is then calling the web service in order to populate AJAX drop-down lists and to return data to the calling Del...

GridView Sorting direction icon up or down?

i need your help give css property into gridview in the header of columns' Css. Up or Down image? string AscCSS = "sortascheader"; string DescCSS = "sortdescheader"; foreach (DataControlField field in gvProducts.Columns) { for (int i = 0; i < gvProducts.Columns.Count; i++) { if (...