.net

how to make a mobile application stay on top ?

I am developing a mobile application for Windows Mobile. I would like that the application is lauched by default by the system at startup and that users cannot minimize it. So only this application is available, all other features are disabled. I m sure that I could define a launcher, which is executed at startup. But some problems c...

How to implement IListSource interface in c++

Hi i want to implement IListSource interface from c++. It contains 1 method GetList() and one property called ContainsListCollection. How can i do this.how to set the property to false/true in c++ ...

FxCop rule don't compare with null value

I'm trying to write a rule for fxcop doing this: if a certain class is compared to null then error. Do you think it's possible ? I wrote a part of code descending ti the statements i could find the type i was looking for but didn't know how to find the value. for know i've got that code but dont know where to go then.. public overri...

How to Create Collapsible Data Grid?

How to Create Collapsible Data Grid in dot net windows form application? ...

Naming: Pricelist vs. PriceList

Which is more correct, "PriceList" or "Pricelist"? FxCop says: CA1702 : Microsoft.Naming : The compound word 'PriceList' in type name 'PriceList' exists as a discrete term. If your usage is intended to be single word, case it as 'Pricelist'. Edit: This is an object with Title, Start/End date etc. ...

How to accept any kind of number into a function as an argument in C#?

c#: How do I accept any kind of number into a function as an argument? Currently my AddDataInt32() asks specifically for Int32, but how I can accept any number, byte, ints signed or unsigned, so I can pass it on to BitConverter.GetBytes()? It's seems silly to write same funct's for each type :( public void AddDataInt32(Int32 i) { Da...

Accessing members with case-sensitive names across languages in .NET

I just came across an interesting scenario. I have a class in C#: public class Test { public int A; public int a; } As C# is case sensitive, this will treat the two variables A and a as distinct. I want to inherit the above class in my VB code, which is not case sensitive. How will the VB code access the two distinct variables A a...

What is the best way to organize WPF styles and ResourceDictionaries in a large project?

I have a large WPF application that uses a large number of styles, brushes, and theming. Managing the large number of styles with multiple developers is becoming difficult. Right now, most of our application-wide styles are in one resource dictionary and the theming brushes are each in their own resource dictionary. The issue is that...

How to convert a double* to an array<double>(6)

I have a function that returns a array of 6 doubles. double* Validation(); I would like to cast this return value in managed code. array<double>^ validationPosition = gcnew array<double>(6); validationPosition = Validation(); I get this error: error C2440: '=' : cannot convert from 'double *' to 'cli::array<Type> ^' How should ...

How to capture a Phone Number

I'm looking to create a windows application in vb.net or c#.net that will capture the phone number of incoming calls. This would be a land line. What would the hardware requirements be? Which .Net libraries would be used? ...

DataGridView bound to DataTable. Getting comboboxes for enums.

If you have a DataTable that has a column of some Enum type. And you bind a DataGridView to this DataTable (myDgv.DataSource = myDataTable).. How can you make the DataGridView show a combobox (or is it drop-down-list? The one where the only thing you can do is select) in each cell of for this column? The combobox should have the curren...

Programming ActiveSync on Windows Mobile

I am developing a desktop app which manages contact information and I want to be able to have it sync with the contacts list on Windows Mobile devices. Which namespaces/APIs do I need to understand to do this? I would prefer something in .NET compact framework, but I can do Win32 as well. I am looking for an approach that is completel...

WinForms - How do you get the size a Control "wants" to be?

When a Control is docked in a container (like a Panel) and is too wide to be shown (so a scroll bar appears), Control.Width seems to return the visible width of the Control (the top arrow in the picture). How do you get the width that the Control "wants" to be? i.e. its full width that you'd see if you didn't have to scroll (the bottom ...

What does ReliabilityContractAttribute do?

Does it do anything at all or it is only for documentation. If it is only for documentation, why documentation doesn't document it? For example these are two methods from System.Array class: [ReliabilityContract(Consistency.MayCorruptInstance, Cer.MayFail)] public static void Copy(Array sourceArray, Array destinationArray, int length) ...

Is there a CapitalizeFirstLetter method?

Is there a method to do that? Could it be done with an extension method? I want to achieve this: string s = "foo".CapitalizeFirstLetter(); // s is now "Foo" ...

JQuery and invisible select - JQuery

I have a select checkbox that has invisible set to false. ASPX looks like this: <input name="selGR" id="selGR" type="checkbox" checked="checked" visible="false" runat="server" fieldname="GR"/> The select box is not even rendered in the HTML which explains why JQuery is not finding it. Is there a way around this? EDIT: Setting style w...

Which controls does the EnableViewState affect on a GridView?

I am cleaning up my viewsource and want to use the EnableViewState. I am using a gridview that has the following. <asp:GridView ID="GridView1" runat="server" AlternatingRowStyle-BackColor="#ECECEC" AllowSorting="true" AutoGenerateColumns="False" OnRowDataBound="gridvw_RowDataBound" ShowFooter="True" OnSorting="g...

Get ThreadName from ThreadID

Is there a way to get a Thread's ThreadName from a ThreadId? (from say, a ThreadID like 10, or 15, etc.) ...

Why does my App.Config codebase not help .NET locate my assembly?

I have the following client application and its corresponding config file: namespace Chapter9 { class Program { static void Main(string[] args) { AppDomain.CurrentDomain.ExecuteAssembly("AssemblyPrivate.exe"); } } } <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-micro...

Binding Grid to a Linq Datasource from Winforms (.net)

Back in the old days (i.e. last month) I'd bind my winforms grid to a dataset and be off and running. By default the grid contents could be updated. (similar to an Excel spreadsheet) But, if I bind a grid to a Linq datasource (either Linq to SQL or Linq to Entities) my winforms grid is locked into a read-only mode. How can I enable an...