Software Development Network Logo
  • Visual C++
  • Visual C#
  • Windows Vista
  • .NET Development
  • Visual FoxPro
  • Visual Basic
  • Smart Devicet
  • Windows Forms
  • VS Team System
  • SQL Server
  • Game Technologies
  • Microsoft ISV
  • Audio and Video
  • Visual Studio
  • SharePoint Products

Software Development Network >> Visual C#

Visual C#

New Question

converts a char into a string
Doubt in Switch-Case statement.
Is it possible to add to a system class?
Check for Updates!!
How to navigate between Forms using Back Button.
byte array to bitmap
Intellisense breaks on Indexer of C5 generic collection library
Problem with Interop DllImport Memory Corruption and AccessViolationException
AcitveX Importer in C#
Windows service controller

Top Answerers

DiasVFX
Frank2808
Rajwebdev
Brandon Bloom
Zoinky
IceAngel89
lbamburg
abhishek thakur
Luc Pettett
CBHCMC
sitemap
Only Title

Answer Questions

  • Eric Cann C# compiler BUG - const delegate assignment within a structure definition

    There is a bug in the C# complirer which Visual Studio crashing. The bug happends when writing a const delegate assignment within the a structure. for example: public struct Temp { private const Action<bool> Foo = delegate() { return false; }; } I searched everywhere to find a link for a bug report. I even called the support team. Unfortunately I couldn't do it online because the the ActiveX control on the web site failed to locate the product id. I even tried it manually but it gives me "Invalid produc id" error. I'm using VS2005 on Vista. FYI, replacing the const with static will solve the problem. Thanks, /Ali (mailto: alij@alcor.concordia.ca ) The compiler was not updated wi ...Show All

  • GunasekaranT anyone have a simple exmaple to map all instances of CPU in performanceCounter

    Does anyone have a quick example of creating performanceCounters for each Processor on a machine,all the ones I have send are complex and I'm sure there must be a simple way. I know how to list all the CatergoryNames, it the listing of the instances within the Catergories that I am having trouble with. Cheers Thanks SalvaPatuel, the computers I am monitoring are remote computers hence this wont work. Cheers for the reply Thanks, I couldn't get your code to work, I know it would be something little but just couldn't work it out. It did point in the right direction and this is the final code I came up with PerformanceCounterCategory Cat = new Performance ...Show All

  • Michael Bird Rounding a number to a number divisable by 5.

    Hi all, I have an application that will store the time where the minutes need to be stored in increments of 5 (0, 5, 10 , 15 etc). What I want to do is to get the current time, then round this to its nearest number divisable by 5. So if 9 was the returned minute from DateTime.Now (minute) then this should be rounded to 10. Is there anyway of doing this Thanks Tryst Thats sorted! Thanks guys. Add 2 (or 3 if the seconds are 30 or more) divide by 5, multiply by 5. Guido How about this: public static int RoundToNearestFive( int num) {     num += 2;     return num - (num % 5); } I think that does what you require. Here's what it does f ...Show All

  • Umesh_DB2 equivlaent use of union in C

    I'm trying to use the equivalent of a union here. I'm getting the following error message - MissinngMethodException was unhandled. The code compiled OK but I get the exception. How should this be coded to work [StructLayout(LayoutKind.Explicit)] public struct DataType { [FieldOffset(0)] public string dstring; [FieldOffset(0)] public int dint; [FieldOffset(0)] public float dfloat; [FieldOffset(0)] public double ddouble; [FieldOffset(0)] public char dchar; [FieldOffset(0)] public byte dbyte; } public struct XMLData { public string Tag; public DataType Item; public XMLData(string tag, DataType item) { th ...Show All

  • Grimal Step by step instruction. Open Form2 from Button on form1 C#

    Hi, anyone able to tell me please how to.. Click on a Button i named Next on Form1.. it will then open Form2 page not as an extra page.. but as though its a new page on the same window. ty Knowing me.. im gonna need click here.. do this... type this etc instructions as ive been reading and nothing works for me. Thankyou One way to accomplish this is by using panels (panel controls)....once u click the button (next) you hide one panel and show the other one ...Show All

  • Itzik Katzav Byte Stream from Barcode Scanner

    Does anybody know how i can access the byte stream returned by the scanner I'm trying to encode byte data of a file onto the barcode. However, am not sure if the barcode itself leave out ASCII character code 128 and above or there's something wrong with how i read the data back (via the keypress event of an empty form, i just translate the KeyValue to its byte value). I tried testing with the full 0-255 ASCII characters with no luck. Data I read back has a lot of bytes missing. So am wondering if i can access the raw byte data from the barcode scanner. Currently using Symbol P304 THanks! finally got it :) had to work with a new scanner instead. one that goes through a serial port and i had ...Show All

  • Muhammad Azeem Azam Which event occurs after a control updates the data binding?

    Hi, I'm looking to find out which control's event occurs AFTER it has updated the data binding source. I have a combo box which I am binding to a property of an object (I want to seperate my business logic from the UI). I want to trap when the user has updated the combo box to re-calculate something, but when I do this on the LostFocus event the objects property still has not been updated by the data binding. Is there another event that occurs after the binding has been updated. I've also tried Validated as this occurs after the update but it also occurs after any control has been chnaged. Maybe there is a way to change when the control updates the data binding source Many Thanks, Lee. AFAI ...Show All

  • AGPX AxMediaPlayer cannot be instantiated because the current thread is not in a single-threaded apartment.

    A real difficult problem I believe. 1. My program is already running in Single Threaded Apartment [STAThread] public static int Main(string[] args) { ... } 2. One of the computers, when running my program, pops this error. System.Threading.ThreadStateException: ActiveX control '22d6f312-b0f6-11d0-94ab-0080c74c7e95' cannot be instantiated because the current thread is not in a single-threaded apartment. at System.Windows.Forms.AxHost..ctor(String clsid, Int32 flags) at System.Windows.Forms.AxHost..ctor(String clsid) at AxMediaPlayer.AxMediaPlayer..ctor() 3. I searched many articles on the web but none of them can really useful to my case. 4. The computer with problem is running .NET 2.0. A simplified Chinese ...Show All

  • TWeiler Build a 'long' number from two int's

    Hello, i'm wondering whether it is possible to "build" a long number from two int's. My aim is to make it platform independent, thus i can't use any shift operators. With them, i would do something like that: long number = (long)myInt | (((long)myInt2) << 32); Does anybody have an idea georg Matthew Watson wrote: The "endian-ness" of the platform should be hidden by .Net, so as far as I know the simple solution using shifts should work... At first I thought that you were wrong, but then I saw the err of my thinking. Their memory footprints are different, but the actual operation is math based, and is done in registers, and the storage mechanism doesnt affect t ...Show All

  • kdancer100 problem with SortedList

    Good Afternoon- I'm having a problem using a SortedList to store objects. Here's the example code: public override SortedList derivitives() { SortedList s = new SortedList(); s.Add(xyz,dxdydz); s.Add(uvw,dudvdw); return s; } The code fails during the second Add, with the following error: Unhandles Exception: System.InvalidOperationException: Operation is not valid due to the current state of the object. in System.Collections.SortedList:PutImpl in System.Collections.SortedList.Add in System.Collections.MyClass.derivitives() ... I tried an example code with SortedList and I can Add() as many strings as I want, is there a problem with SortedList holding abstract objects they are all of the same type... thanks, Philski ...Show All

  • Nickeay Reading other user data from registry

    Here is a summary of what I am doing: 1. Running C# application as user1 2. Retrieve ntuser.dat file for user2 and load as a hive in registry 3. Reading HKEY_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders My issue is that when performing #3. The ntuser.dat file for user2 has %USERPROFILE%... in it. When the application retrieves this it is returning the %USERPROFILE% variable for user1. So the results from the ntuser.dat file for user2 for Desktop is C:\Documents and Settings\User1\Desktop. This is not an acceptable result. I would be happy with either of the following scenarios: a. The application returns the reg entry as-is: %USERPROFILE%\Desktop b. The application is able to convert the %USE ...Show All

  • alfredgoldberg Getting Between The GridView

    I've been racking my brain and my VS trying to figure out how I was gonna do this. Maybe someone has an Idea that I just haven't figured out yet... I have a gridview that is populated in the code behind with several columns worth of data from my trusty database . I'm running VS2005, .NET 2.0... The data, or the columns aren't important. My issue is in Popping an area between rows when you hit a button to view that row's "Details". The details section will essentially hit the DB again and fill a section under the selected row and above the next row with the data. In other words, I'm looking to get between two gridview rows and pop some data in there based on the selected row. My two best solutions so far: 1) P ...Show All

  • cheesetarmac main menu resizing problem

    I have a program with a main menu that has 4 submenus in it. Depending on certain options that are chosen my app resizes itself. MY problem lies in the fact that with one option choice my window becomes too small and only the leftmost 3 of the 4 submenus can be seen/accessed. Without changing the size of my window is there any way to do something about this Thanks Although it is not very good for the user it is applicable in some cases. I think I just found what you mean - take a look at ToolStrip.LayoutStyle Property , set it to Flow as here and this is it ;) this .menuStrip1.LayoutStyle = System.Windows.Forms. ToolStripLayoutStyle .Flow; Hope this helps you could se ...Show All

  • patty boy90 inherit from List<>

    Hi in my older project in dot net 1.1 i use a collection clas to inherit but now i transfer my project in dot net 2 and i like to use List<> for my collectionbecause is esier to serialize i think so... so I neat to inherit from List<> like in onld dot net 1.1 ////in dot net 1.1 public class MalliTavolineCollection : CollectionBase { public MalliTavolineCollection() : base() { } public bool Add(MalliTavoline mt) { if(mt.Malli.ID == 1) { List.Add(mt); return false; } } so how can i archive this in dot net 2 in generics public class MalliTavolineCollection <T> : List<T> { //////Then help please } What exactly is the problem All you should have to change is the base clas ...Show All

  • RolandAbt Does not exist in the current context

    Ok, this has got to be one of the most utterly newbie questions out there, but this is my first programming class and I am stumped. At the momment I am simply trying to pass the value in a listbox to a messagebox. When I try to compile the code I get the message that VegetableLst does not exist in the current context. I know (think) I need to somehow pass that variable to the event handler, but am unsure what to do. Here is my code: /* * User: Shiloh Madsen * Date: 2/17/2007 * Time: 3:08 PM * Purpose: Take an order of 4 categories of items and pop a price box. */ using System; using System.Collections.Generic; using System.Drawing; using System.Windows.Forms; /// <summary> /// Description of MainForm. /// </summary> pub ...Show All

31323334353637383940414243

©2008 Software Development Network

powered by phorum