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

Software Development Network >> Visual C#

Visual C#

New Question

using foreach to loop string[] and how to check for last index
using mapped tables
Winsock2 API - receiving data
Getting started with Business objects
one simple question on compiling the program.cs
DllImport call using a struct as param throwing exception
Using Calendar.SelectedDate to update Gridview
Converting into decimal
Index out of range - seraching Active Directory
Reading Database Table Names

Top Answerers

litewoheat
dr.acv
Will Merydith
fathi S. Elashery
ntsoo
Rich6782
SouLDragooN
ray_newbie_SSIS
DonAM
KrisV
sitemap
Only Title

Answer Questions

  • narend Hadnling MessageBox

    In my application when user click close button it display a messagebox askig it should save de changes or not.Three option is der yes no cancel.I have written de code in Closing event.First two cases is ok.But when i press cancel it still goes to dispose and close the form.But i want when user press cancel it should do nothing .Please tell how to handle dat.And where to write dat code. Waiting for ur suggestion set e.Cancel = true; if they select "Cancel" in the form closing event, where you are prompting them if they wish to save changed ...Show All

  • dbdog ignore mouse down event

    I'm new to C# programming, learning it for pleasure on my own time. As an exercise, I'm creating a simple Windows program that 1) takes the mouse-down event as an 'anchor' point, 2) while dragging the mouse around continually draw a line from that anchor point to the current mouse position, 3) once the mouse-up occurs, shrink the resulting line down automatically until it disappears. Not too hard, and it works perfectly fine. My problem is that I do not want the Form to accept any mouse-down's while the shrinking logic is occurring. Currently, while the line is shrinking, I can do some more click-and-drags, and once the shrinking completes, those subsequent lines are drawn/shrunk in like fashion. I want to effectively ignore any mouse- ...Show All

  • Ljhopkins Updating references

    I'm trying to update my .config file In the dotnet 1 code to dotnet 2 change I have changed the 1.0.0.0 to 2.0.0.0 below and added the correct assemblies for the latest enterprise library. Is this correct I'm a little worried about the oldVersion tag < dependentAssembly > < assemblyIdentity name = " Microsoft.Practices.EnterpriseLibrary.Common " publicKeyToken = " xxxxxxxxxxxx " /> < bindingRedirect oldVersion = " 0.0.0.0-65535.65535.65535.65535 " newVersion = " 2.0.0.0 " /> < codeBase version = " 2.0.0.0 " href = " file:///${appFolder}Microsoft.Practices.EnterpriseLibrary.Common.dll " /> < publisherPolicy apply = & ...Show All

  • edralph Value does not get assigned??

    I am trying to assign the OrderID from my OrderLegDetail object...when i step through the code while it running "this.OrderEntryID" has the value of the current instance of the OrderEntryID but it does not assign it to the OrderID of the OrderLegDetail object...it take it to its default value of -1 but i cant seem to figure out why.... for ( int x = 0; x < Legs.Count; x++) { ((Tracking.BusinessObjects.OrderLegDetail)Legs[x]).OrderID = this .OrderEntryID; } Try if this makes a difference: for ( int x = 0; x < Legs.Count; x++) { Tracking.BusinessObjects.OrderLegDetail leg = (Tracking.BusinessObjects.OrderLegDetail)Legs[x]; leg.OrderID = this.OrderEntryID; Legs[x] = leg; } -- SvenC ...Show All

  • Eric White King Launching an application from within a C# application

    When you want to launch an application from within Visual Basic 2005 you use the following format: Process.Start("......"). How do you accomplish this using C# I haven't been able to find an example. Before I answer your questions I must suggest that if you have any more questions you should post them as new ones on the forum so that others are able to see them. That way you aren’t waiting for me to check on my previously commented on threads for help. As to #1... just the same way, only you add a semicolon to the end of the line (which most lines of C# code have). One other change from your line is that you need to have the () characters at the end of the two method calls ala: txtCloc ...Show All

  • kaimerachin Enum / Struct / Fixed value enumeration?

    I have a (double) value that represent each month. For example : Jan has a value of 1.5, Feb 3.2, Mar 0.4, etc until Dec. What is the best way to enumerate this value without using an array So if a user type 3 or Mar in a textbox, it will display the value of 0.4. I am trying to avoid using if/else or case. Any suggestion Thanks, William cool answer. Tom here is a daft question, please forgive me. I'm still new to this dictionary stuff. Is that not like a hashtable where the key and value is given, key has to be unique always...whats the difference with the HT and the Dictionary How about using a Dictionary<string, double> to create a mapping between strings and the double values Dicti ...Show All

  • chxfryer Store a reference

    I would like to pass along a reference to a structure to another class and then store the reference in that other class. If i had pointers, it would look like this: someStruct myStruct = new someStruct(...); receivingObject.ReceivindMethod(&myStruct); and the implementation... receivingObject::ReceivingMethod(someStruct* passedStruct) { localStructPointer = passedStruct; } However.. if I give the structure to another objects method and use ref to pass by reference, I can use the refenerence as such in the receiving method, but how do I save that reference so that I can access it as a reference at another time If I assign the referenced struct to a local struct, then it copies the contents... and I am not ...Show All

  • JeffK_ how to add timeOut without using thread.sleep

    hi, i have wrote a client/server ClassLibrary, i use separated thread to receive packets(receiver thread) , and i receive packets but not in order, for example if i send requestA and request B, i can get responseB b4 responseA, and in some cases the server will not send responseB (this is exactly how i want it to work) so here its my question, How can i add timeOut to my class (without blocking) right now i use thread sleep something like this int counter = 0; bool MethodB() { Client.SendRequestB(); while (counter < 1000 && responseB == null ) { counter++; System.Threading. Thread .Sleep( 60 ); } if (responseB != null ) throw new ABCException ( "TimeOut: You sent R ...Show All

  • bertH Quick Find in visual studio 2005 disappeared

    I used to be able to hit control key and F key, it pops up the Quick Find window, now this does not work anymore. All the options listed under pulldown menu Edit and Find and Replace do not display any window. it just did nothing. could anyone please let me know how to get those functions back. I finally solved it. The Find window was hidden way to the left of the monitor beyound frame. I can't see it. But I moved my mouse along the left edge of the monitor slowly, at one point,the cursor changed into a resize two ended arrow shap. so I clicked and dragged. The window came out! I don't know how that happened. But It was tricky to get it back! I am glad that I ...Show All

  • arcliner escaping characters

    i need to write some query in code i want to know if csharp has anything like heredoc in php i hate having to write my queries like this: "select group_name = group_name, " + "group_key = group.group_key " + "from dbo.sponsor " + "INNER JOIN dbo.client s_name " + "on s_name.client_key = sponsor.client_key " + "INNER JOIN dbo.[group] " + "on [group].sponsor_key = sponsor.sponsor_key " + "where plan_key = " + planKey+; it gets really annoying hi, i guess you have many solutions now , i forgot to say one thing the symbol '@"' befor the stri ...Show All

  • TG_KG How to catch a file save on the fly?

    Hi! How can I know if a certain file is changed(saved) after someone changes the file immediately Is there an api or hook method that can be used to provide this Thanks. no I don't but you should stay away from Win32 API if you can as it degrades performance and kind of defeats the purpose of .NET and its classes! Thank you for your answer ahmedilyas! Do you know how to do that using win32 api I think the filesystemwatcher can do this: http://msdn2.microsoft.com/en-us/library/system.io.filesystemwatcher.aspx this is in .NET 2.0 everything is in that link :-) ok, thanks. ...Show All

  • ola_lawal How can I retrieve advanced file information?

    ...Like the Title of a song, the Bitrate, Album, etc. Thanks, Year only shows up as 3 digits, and it's four in the properties window. Why is this I tried doing that, but it didn't help. try this:   Dim theFileStream As New FileStream (PathToFile , FileMode.Open) Dim theByteBuff(128) As Byte theFileStream.Seek(-128, SeekOrigin. End ) theFileStream.Read(theByteBuff, 0, 128) theFileStream.Close() Dim theEncoding As New System.Text.ASCIIEncoding() Dim theTagInfo As String = theEncoding.GetString(theByteBuff) If theTagInfo.Contains( "TAG" ) Then Dim theTitle As String = theTagInfo.Substring(3, 30).Trim() Dim theArtist As String = theTagInfo ...Show All

  • Neotech Problem with Reflection: PropertyDescriptor.SetValue()

    The method it supposed to take a CustomControlDesigner which has a Control contained within it. I want to do a deep copy of it, without having to keep updating the method whenever I change the attributes of CustomControlDesigner. The problem is that the method is throwing a System.Reflection.TargetException(Object does not match target type) on the line with //*** (the SetValue method) The type names that the message box shows are always identical - I assume the problem is that the one I'm setting on the returnable object is cast to 'Object'. Does anyone know what I can do to cast it to its most specific type, or fix this error some other way public static CustomControlDesigner CloneDesigner( Cu ...Show All

  • ant42 The process cannot access the file **HARD ONE**

    Ok, This is a hard one...For me at least. I have a jpeg image that is being used by a picturebox in my windows form. During the duration of my program, I need to let the user replace the file that my picturebox uses an an image. I recieve the following error: Additional information: The process cannot access the file "C:\Documents and Settings\Ryan Barger\My Documents\Visual Studio Projects\WindowsApplication1\bin\Debug\workingDirectory\images\CRMImage[1].png" because it is being used by another process. I have tried disposing the image prior to replacing the file. Is there a way to close the file that was being used by the picureBox so the file can be replaced Thanks! I ass ...Show All

  • Dr Adrian Colquhoun library not registered error

    Hello, I hope someone will have an answer to this question... Using VS. Net + C# I have a a console project called implementer that communicates with another addin project. Both are supposed to send and receive a "struct" that holds a hashtable to store/change info. I got the addin to show up right and it starts listening to the events been triggered by excel. In one of the events, the addin class, via invocation, is supposed to instantiate an instance of the struct and pass it to the running instance of the implementer class which changes and modifies the info in the hashtable of that struct. when trying to send that struct (which is a dll file by itself but added to both projects as reference) I get the error message s ...Show All

787980818283848586878889909192939495

©2008 Software Development Network

powered by phorum