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

Software Development Network >> Visual C#

Visual C#

New Question

Custom Button Background
System.ArgumentException: ContextMenu cannot be shown on an invisible control
automatic destructor
[otp] Session expiration
how to get current line number ?
how to convert text string to decimal numbers?
Collections and Arrays Question
How to use DllImport with c++ functions that take a function pointer as an argument?
c# how to update point array using foreach loop
C# and SQL Query

Top Answerers

NickHHH
Ala Kushlaf
pinoyz
hye_heena
UnKnown Nick
Vijay R
Tim Dallmann
Winkling
Melvinsb
matti-81
OpenLink Virtuoso
Only Title

Answer Questions

  • fshrago How to Iterate through List or IList

    i can add the values to the IList or List, if I need to get these values in the way they went it...Say I added 5 addresses to the list and I want them one by one... I can use foreach and get all, but I need a way to only get one at a time or two at the max as I need to update some textboxes... Hi try ContactPhoneNumber.IndexOf(phone) to get the index secondly try this for (int i =o; i< contactphones.length; i++){ Phone phone = (phone) contactphones ; } Hope this helps, please close this thread if it does what is the exception usually you can index via the indexer as shown previously. I can understand C# compiler throwning an error with your if statement because theList[0 ...Show All

  • Kifaro How to: make a click-through component

    Hi, How to make a control which is click-through or click-transparent. The control itself is not transparent or only partial transparent. The idea is to make a highlighting control or indicating control which must always be seen in front of all other controls (circle around foo, arrow pointing to bar, etc.) but must not inhibit user mouseclicks. I tried using transparent colors but they inhibit mouseclicks. I also tried the WS_EX_TRANSPARENT style but this makes the opague parts transparent too. Your help will be much appreciated. Regards, Tonn ...Show All

  • dtrickett How to copy Array of objects, by values?

    abstract class AbstractClass { public abstract double this[int i] { set; } } class Point { public double x; public double y; } class ClassA : AbstractClass { private Point[] points; public ClassA(Point[] point_arr) { points = (Point[])point_arr.Clone(); } public override double this[int i] { set { points .y = value; } } } class ClassB : AbstractClass { private Point[] points; public ClassB(Point[] point_arr) { points = (Point[])point_arr.Clone(); } public override double this[int i] { set { points .y = value; } } } public static void Main() { Point[] point_arr = new Point ; int i; for (i = 0; i < 8; i++) point_arr = new ...Show All

  • Ted. Inserting \n and or \r into a string to populate a textBox

    I have created a Windows Application in which I build a String from inputed form data ( Strings + literal strings) to display in a multi-line textbox. When I try to format it by putting "\n\r" in various places they show up in the textBox as little rectangular boxes. Is there another way to create line breaks Thank You, Mike I think \r\n is the correct order. However, I just use the Environment.NewLine property, which is more platform-independent but does require additional string concatenations. Changing to \r\n worked. Thanks Mike As sirjis said, you really should use Environment.NewLine instead. ...Show All

  • dclements Get the computer Id

    I want to get computer id that always be uniqe even if windows of that computer have been changed. please tell me how and where I can find something like this. Code sample is helpfull too. well what happens when it doesnt work It doesn't compile and the error screen shows. Is there anything I need to do prior to your code Eragon. where can i find my computer id so you are after a way to find a uniqueness of the computer it self This then has nothing to do with Windows. you have to find another way. This could be as posted, by looking at the SerialNumber of a harddisk or getting the Processor ID using WMI. add a reference to System.Man ...Show All

  • dayjur Cast <IList>

    I have something like this... public static IList < AbstractKeyValueEntity <T>> Values<T>( ListBox listBox) { IList < AbstractKeyValueEntity <T>> results = new List < AbstractKeyValueEntity <T>>(); foreach ( ListItem item in listBox.Items) { if (item.Selected) { results.Add( AbstractKeyValueEntity <T>.GetLookupByEntityID(item.Value)); } } return results; } I make a function call something like this something is of type IList something = ( some ) CallFunction .Value< some >(DownList); I get an error saying Cannot implicitly convert type ''some' to 'System.Collections.IList'. An explicit conversion exists (are you m ...Show All

  • prashantsable sqlConnection & intellisense

    I defined a database in SQLEXPRESS, made tables and went to VS2005 C# browser to continue with my app. Naturally, I defined the connection in VS2005 Studio. I found to my surprise that the connection, dataset and dataadapter for this sql database were already in Intellisense dropdown menu. I set up another database and went back to my C# environment, defined the connection in VS2005 and found that there was nothing in Intellisense pertaining to the second connection. Why is it so I do not remember anything particular I did to get the first dataset present in IntelliSense. Thanks. Well those objects are there in first dataset because are created, and second dataset doesn't have them. If you create a dataset using new Datasou ...Show All

  • tnsgod831 generic contraint for nullable objects

    I have a generic method with a single parameter that must be nullable - a nullable type (int etc.) or a reference type. private static void SomeMethod<T>(T value) where T : Nullable Doing a search brought up this: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=60915&SiteID=1 which mentions using INullableValue, but this seems to have been removed now. Is this possible There is no single constraint that does this, but you can easily achieve the same effect like so: private static void SomeMethod<T>(T value) where T : struct { ... } This will ensure that SomeMethod can only be called with a nullable type. int a = 5; SomeMethod< int >(a); The s ...Show All

  • Tim Long C# - How powerful?

    I know C# is sort of like C++, but is it as powerful as C++ Yelnik wrote: Well I would really prefer to learn C++, but it seems that is the only programming language Microsoft didnt put "Absolute beginners guides" for. There may not be any plenty of resources for C++. However, I would suggest C++ is the perfect launching pad for learning an OOP language! In my experience, u will learn the conepts of OOPS in C++ and u will start feeling the same in VC++. Ofcourse, the learning edge is quite distant between MFC (Microsoft Foundation Classes - can be said as the earlier version of Microsoft VC++) and the current VC++.Net, but it could be learnt on some serious good effort and a littl ...Show All

  • usm2000 A question of OO structure...

    Hello All, I'll do my best to explain what I'm trying to accomplish and look forward to any and all suggestions you have for the "proper" way to do this (realizing there is no 100% correct way, but some methods are more optimal than others). I apologize in advance for my n00bness. For this example, I'll use football (american) players. I want my Player class to have a List<Stat> collection of my Stat class. Each Stat, which is an indicator of how well a player plays a particular position, should have a base value but be able to return a "true" value which is a calculation of the base value plus a percentage of one or more other stats. For example: a Player's Halfback stat might be base value plus 50% of the Fullba ...Show All

  • Vince Cooper 58 enumerator modification

    i want to delete an object from arraylist after performing a method. but when it says Collection was modified; enumeration operation may not execute. this is my code: while ( true ) { lock (m_lockobj) { //creates the enumerator to loop through all elements in the array list IEnumerator enumerator = arrlst_ResetActionTable.GetEnumerator(); while (enumerator.MoveNext()) { ResetActionFire m_ResetActionFire = ( ResetActionFire )enumerator.Current; TimeSpan diffenceInterval = ( DateTime .Now) - ( DateTime )(m_ResetActionFire.lastTimeStamp[0]); long lThresholdDuration = ( long )diffenceInterval.TotalSeconds; if (lThresholdDuration >= m_ResetActionFire.lResetThresholdDuration) ...Show All

  • Ccm1st FileLogTraceListener crashes my app when I change system date

    Hi Friends, I've been using FileLogTraceListener to log some messages to text files in my application. The application is basically a server which runs 24/7. Every other moment there are some or the other messages to be logged. When the server is running and I change the system date, this crashes my application. I can figure out that since the trace log is using system date for file names so this might be the problem. But how do I get around this problem Also, how is it handled when the system date changes automatically at midnight Thanks, Kunal this is strange... I was not able to reproduce crash. Most probably it is related to remoting. I tried locally and it worked fine. I would advise you to add informlistener to Trace ...Show All

  • Nicholas Buse How Visual C# is better than Java ?

    Can u give me some points ragarding how the c# is better than java what is future of C# in compition with java Can you give us a definition of "better" And how will those criteria evolve in the future Speed. The question is good. At first C# is more faster than Java. And C# is include .NET technology. This is a good reason for many programmers. And C# has a very improvment IDE (MS Visual Studio 2005)   Have a good coding... ...Show All

  • Hugo Soares Notepad syntax higlight code

    How can i add syntax higlight in my notepad application, i am a newbie in c# and this forum. :) you would need to use the RTB (RichTextBox) control in your application. This will allow you to syntax highlight/format your document and save it to an rtf (or plain text) format. you can use things like select() method which will allow you to select characters and highlight them http://msdn2.microsoft.com/en-us/library/system.windows.forms.richtextbox.aspx There are many sysntax hilight solutions available like Open source IDE you can download it and look to its source code http://www.sharpdevelop.net/OpenSource/SD/ and this use Compona Syntaxbox http://www.codeproject.com/useritems/fireballcodeeditor.as ...Show All

  • PaulC1234 GETTING MORE THAN ONE INTERFACES...

    Hi All, I am not familiar with Traffic Control API yet. I was able to compile and run the code I created using Visual C++. The problems are the following: (1) There're two interfaces enabled (3Com EtherLink XL 10/100 PCI and Intel(R) PRO/1000 MT). When I call TcEnumerateInterfaces, my program only gets information about the first one. If I disable that one, the program gets the second one. Also, tcmon.exe recognizes both interfaces. The code is the following: TC_IFC_DESCRIPTOR InterfaceBuffer[20]; PTC_IFC_DESCRIPTOR pInterfaceBuffer = &InterfaceBuffer[0]; ULONG BufferSize = 20 * sizeof(TC_IFC_DESCRIPTOR); result = TcEnumerateInterfaces(ClientHandle, &BufferSize, pInterfaceBuffer); Question (1 ...Show All

434445464748495051525354555657585960

©2008 Software Development Network

powered by phorum