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

Software Development Network >> Visual C#

Visual C#

New Question

C# - How powerful?
form closing problem
namespace question
Creating an MS Project Object in C#.NET
Generating a random string of letters
How to use GC.Collection() and Dispose()
Strange behavior in catching COMException
Error highlighting
How to read current active IE window's html content
Passing values and references

Top Answerers

qmatteoq
Rodrigo Angelo Figueiredo
Aaron Oneal
ram013
~rabin
Keith_EN
robben07160
gamesplant
Stefan Ghose
Bachmo
sitemap
Only Title

Answer Questions

  • Evan Mulawski Use this and base together?

    Hi, I was wondering if there is any way that I can use this() and base() together in a constructor. I mean a construct like this: public MyClass(string arg1, string arg2): base(arg1), this(arg2) { } thanks Thomas Sergei Almazov wrote: No, you cannot do it, because "this(arg2)" constructor will also call base constructor. General recommendation is to create the most general constructor with all possible arguments that will be used by other more specific constructors. For your example it may look like: public MyClass(string arg1, string arg2): base(arg1) { _arg2 = arg2; //Other initializations } public MyClass(string arg2): this(null, arg2) { } public MyClass(): this(nul ...Show All

  • Andrew Mercer Another form or an assembly?

    I am in the process of creating a larger piece of software, more in the design, than implementation. I am trying to find out the best practices. At the same time I am trying to figure out how visual studio can help me in these things. I have a main form, from where I run the other items of my project. Basically a form with buttons that load other forms. Now in my project, a have all these forms now. Would it be a better idea to make this into an assembly per form What I mean is that the main form just loads the correct assembly, when you click a button. Thanks in advance :) Sune P.S. Happy New Year everybody. In my opinion, creating one form per assembly is overkill for most situations. Perso ...Show All

  • iamme events still running c#

    How can I determine what events are still running while i am in an event. For example : I have a panel build with 1000 textboxes at runtime. (each textbox is a like a cel in a spreadsheet) In the keyeventhandler keydown i catch the keys (up,down,left,right) to move the focus to another textbox (cel) in the panel. Moving the focus to another textbox (cel) in the panel starts other events(events enter , event leave, ...). Is there a way to know if there are still events being executed (events that are not finished) while I am in an event. With the information of events still being running ,I can decide to do Aplication.DoEvents() or change the way an event must behave. Ok, you need to seriously ask yourself if your current pr ...Show All

  • jduartedj does managed code take precedence over native code?

    i wrote a small demo C app that sends a message and a struct to a managed C++ dll. this C++ dll marshalls over the message and struct to a managed struct and sends it to a C# assembly that just prints out the values of the struct (to see that everything came over ok) and sends back a string reply, it also prints some debug text to console. before the call to the C++ dll, i make a few calls to printf to print to console. when it runs, it does the C# assembly debug statements before the native C printf statements. other than that everything looks ok. does managed code take any sort of precedence over native code the whole thing is a proof of concept. so the quick and dirty: ok so i have a C# assembly, i ...Show All

  • Evan Mulawski convert integer 1D array to int 2D array.

    How can I convert int 1D array to int 2D array Thanks, Tammy Hi, What do you mean exactly, there are more than one possibility. Can you give an example... Charles This should work, you pick the desired size of the 2D array, then it fits as much of the 1D array in as possible. public static int[,] Covert1DArrayTo2DArray(int[] src, int desiredWidth, int desiredHeight) { int[,] dest = new int[desiredWidth, desiredHeight]; int count = src.Length; if (desiredWidth * desiredHeight < count) { count = desiredWidth * desiredHeight; } int index=0; for (int y = 0; y < desiredHeight; y++) { for (int x = 0; x < desiredWidth; x++ ...Show All

  • rkwarning Difference between struct value or reference

    What is the difference between myStruct aStruct; and myStruct aStruct = new myStruct(); I would have thought that the latter was a reference type and if I put aStruct = bStruct; then aStruct would point to bStruct but in fact it just seems to copy the contents. I stand corrected. Thanks! When you say "the latter creates two instances" are you saying myStruct aStruct = new myStruct(); creates two instances The latter is not a reference type. Depending on the struct, the built-in bitwise memory copy would be called, or the overridden operator would be called. The latter would essentially create two instances of the struct, ov ...Show All

  • Perley Applying Property Attributes decorating a class to its member properties

    I am using attributes to supply range values for properties of an object being displayed in a propertyGrid. This works great when I am dealing with primitive types like int and float. However I have more complex data types that I want to decorate with a range attribute and have the attribute applied to member items of the object that was decorated. It should be noted that I have created custom type and property descriptors so that I have control over those description passed to the property grid. This allows me to control how the property grid displays properties dynamically. To apply the range constraints to the property I have overridden the SetValue Method in the property descriptor. The problem is when you are changing the value t ...Show All

  • OmidQRose Getting an interface implementation from a type

    Hi There, I have an assembly which contains a type which I know to implement a specific interface. I can retrieve the interface from the type but whenever I try to cast the type directly to the interface (to get its implemented properties) the cast fails. Here's the code: Type plugInInterface = type.GetInterface( "IPlugIn" ); // This succeeds and I get plugInInterface back. if (plugInInterface != null ) { // Found the a type that implements the IPlugIn interface. // Load it up! IPlugIn plugInType = null ; if (type is IPlugIn ) // This fails. { plugInType = type as IPlugIn ; } } Does anyone know what I'm doing wrong here It seems that if I can successfully retrieve the ...Show All

  • Antonio Calderon Three questions regarding C# and .NET of today and tomorrow

    (I was pointed to this forum by Erik Jarvi after pestering him personally with these questions) Hi I have three questions regarding C# and .NET. I don't know if this is the best forum for these questions but here goes. C# question 1: Is there any possibility in .NET 2.0 to create a class that mimics the semantics of this: class A<B> : B { } It might look obscure but that doesn't stop it from being usable. Let A be a generic IDisposable implemetation that encapsulates all the tedious implementation details of IDisposable pattern and let the programmer just implement the disposing. If I had my_class which need to inherit from your_class. Let's say I need to add IDisposable pattern to my_class. Then if the above would ...Show All

  • stefciu how do i handle copying to a folder?

    Hi, we have an application that has to do something when copying or moving to a specific folder finishes. How do we handle if a folder has copying or moving process on it in c#   t_pack wrote: Thanks for the reply. Copy is done externally either from a local source or by the network, not inside the code. Only the name of the target folder is known, the problem is that how to realize if something(file or folder) is being copied to the target folder at any time. Thanks Thanks for reply I think the solution will look like this using System.IO namespace:- protected void WatchRootDirectory() { // Create filesystemwatcher and set property values. ...Show All

  • YFell String To Guid

    Hello my Friends, There Are any way to convert a String into a Guid if the string has the form By example, i have a variable like: string ID = " 12b7a44f-61b3-48af-ab91-a6bf83a2d42a" And i want to assign the value to a variable with guid type Guid ID_Conv something like that: ID_Conv = ID; Can you help me please Thanks That's true Omega, Sorry, i didn't remember that i had this response. no idea if this helps: Guid theGuid = new Guid( string ); ahmedilyas wrote: no idea if this helps: Guid theGuid = new Guid( string ); Hi Dnieto23, You posted a similar question ( Problems with GUID ) which I had given the same answer to.... OmegaMan wrote: You cannot as ...Show All

  • JimMcCaw ServiceProcess

    Hi, i'm trying to obtain a list of services on my computer as follow: string s = string.Empty; ServiceController[] services; services = ServiceController.GetServices(); listBox1.BeginUpdate(); foreach (System.ServiceProcess.ServiceController ctrl in services) { System.ServiceProcess.ServiceControllerStatus stat = ctrl.Status; System.ServiceProcess.ServiceType st = ctrl.ServiceType; s = ctrl.DisplayName; s += " " + ctrl.ServiceName; s+= " " + stat.ToString(); s += " " + st.ToString(); listBox1.Items.Add(s ); } listBox1.EndUpdate(); but i don't know how to obtain the startup type of specific service. ...Show All

  • Anatoly Porsev Disabling Ctrl + Alt + Del

    I'm writing an employee login application where I of course don't want users messing with Windows while it is running; Therefore I need to disable ctrl+alt+del. I've spent 2 hours now trying to figure out how to do this in C#. I've read from some people that I have to write my own version of GINA. I've also read about using WlxLoggedOnSAS to capture the ctrl+alt+del event. Are these the best mothods for doing this If so how on earth can I accomplish this task Thanks for the help :) I'm not at all concerned with the 'security issues' related with disabling ctrl+alt+del. This is a solo workstation not connected to any networks and is running Windows XP. I've got a biometrics system that I'm interacting wit ...Show All

  • Rabtok What is the equivalent solution of Microsoft?

    What is the equivalent solution of Microsoft to produce similar page (Please register for a real time trial) http://www.peachtree.com/download/trial.cfm Note that in the trial, user can try software online and the winform UI is seen inside the browser. I know that in .NET, we can load a single .dll(not an entired winform application) in a webpage. Although I haven't registered for a free time trial my guess is that they use ActiveX control. It is possible to host a User Control in IE. Depending on what exactly your requirements is you could take a look at ClickOnce deployment: ClickOnce Deployment for Windows Forms Applications ...Show All

  • migz148 HOW DO I: Insert on a table, using tableadapter?

    Hi, I guess my subject said a lot of my problem, but anyways i will try to explain it. this is it: Im new at this c# stuff, so i was tryin' to insert a row, into a two colums table. after tryin' with the DataRow Class, I got to the "tableAdapter.insert" method. it worked once... but I could'nt commit the changes.. not even using the AceptChanges method. anyways you get my point... anybody can help you need to import the System.Data.SqlClient namespace at the top of the class file to obtain the Sql classes thx, for the answare but I guess its not exactly what im looking for... i mean, i did that once, and it worked. but now when i call tableadater.insert, it does'nt even insert, temporally on the table... ther ...Show All

717273747576777879808182838485868788

©2008 Software Development Network

powered by phorum