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

Software Development Network >> Visual C#

Visual C#

New Question

compile in 1.1 framework
Method Attribute Inheritance from Interfaces...
Comparing objects
NetworkStream doesn't support seeking
C# Creating a derived class from a base class.
How can I quit the execution from the recursive function?
HELP, CANNOT WORK C#
How do I convert a 4-byte array (of type bytes) into a 4-byte floating-point?
How to nest any custom files, other than .designer.cs /.designer.vb or .aspx.cs, in VS.NET 2005
Import themes to my appication

Top Answerers

PerPixel
CNP
hellomahesh
Ed Hansberry
Bartosz
Seiggy
KenHerman
alka_mehta
Fabien Masson
Avi29
sitemap
Only Title

Answer Questions

  • koosha create object on another thread

    Hi, I need to be able to create objects on a designated thread. This thread waits and whenever a request comes from another thread, it creates the desired object, and returns it. The objects I need to be created are derived from Form, so it matters on which thread it gets instantiated. So, essentially, the main thread could do something like: MyForm f = FormsManager.Create(typeof(MyForm)); Where MyForm has a default constructor. Behind the scenes, the Create method switches to the forms thread and instantiates the requested form, and then returns it to the calling thread (all of this, as you see, is transparent). I need to know how to switch from the main thread to the forms thread, and how to return the result (the created form) back to t ...Show All

  • mahima Rich text box problem...

    Hi… In my application…I am trying to add data received on comport in a rich text box. Rich text box is on second form & my SerialPort.datareceived event is on first form. Here is my sample code… form2 f1 = new form2(); Serialport. .DataReceived += new SerialDataReceivedEventHandler (port_DataReceived); private void port_DataReceived( object sender, SerialDataReceivedEventArgs e) { ReceivedData = comport.ReadExisting(); f1.Controls[0].Text = ReceivedData; f1.Controls[0].Invoke( new EventHandler ( delegate { f1.Controls[ 0]. AppendText(ReceivedData); })); } But I am getting error on th ...Show All

  • Sqnyy application config file for interop between legacy C and C# dll

    i have a legacy C application that will communicate with a C++ dll that is compiled with the /clr flag. This C++ dll then calls a method in a C# assembly. I would like to place the C++ and C# assemblies into a different folder than the C app. So would I need to create a config file that uses the C application's name and place the public keys and full paths to the corresponding assemblies in it say my C app is called myapp.exe. then should i make a config file called myapp.exe.config or is this only needed when a managed assembly will need to reference another managed assembly in a different path to add to this, i would like to place all the DLL's into the system32 folder. currently i receive System.IO.Fi ...Show All

  • ChanKaiShi Shutdown.exe problems

    Process shutdown = new Process(); shutdown.StartInfo.FileName = "C:/WINDOWS/System32/Shutdown.exe"; shutdown.StartInfo.Arguments = "-s -f -t 20 -m \\deruu"; shutdown.Start(); I can get it to log me out using argument -l only, but with that I only get a "Frozen" cmd window titled "Shutdown.exe" and nothing happens. Opens up shutdown.exe but nothing happens hang on, I think I know where the problem is. Process shutdown = new Process(); shutdown.StartInfo.FileName = "C:/WINDOWS/System32/Shutdown.exe"; shutdown.StartInfo.Arguments = "-s -f -t 20 -m \\deruu "; shutdown.Start(); the bold part should be 4 back ...Show All

  • sergun with keyword

    Hello, In VB 6 this keyword means inserting an object to the context. fields and properties of the object can be accessed directly, without a variable name (like when writing code inside a class and all the properties of "this" are accessible). In VB the dot "." operator is used, in other languages like delphi - you can just write the property \ method name. Is there a "with" keyword or something similiar in c# Thanks. Afaik there is no "With" construct for C#... Simp,y No :) Best Regards, Rizwan aka RizwanSharp well I do not agree with the saying that "with" gives: "Small or non-existent readability benefits" but I guess I'm alone... s ...Show All

  • YorickPeterse Using the 'New' operator, and 'This' keyword.

    Ok I know how to use 'New' to instantiate a class. Which would look something like this: Class1 result = new Class1(); But there is another form that I don't understand: this.btnClose = new System.Windows.Forms.Button(); What's going on here, is this an assignment or a call I can't tell, and if it is an assignment what is being assigned Also what exactly does 'this' keyword do Your second question being answered, I'll answer the first one. Class1 result = new Class1(); this.btnClose = new System.Windows.Forms.Button(); Now just comparing the above 2 statements what we see is that btnClose is an object of type System.Windows.Forms.Button like "result" is an object of type Class1. yo ...Show All

  • Stefoon Generic 2.0 and Predicats

    Hi, I have a list<MyStruct> and would like to use it find a struct in the list. let's say .. struct MyStruct { string _name; public string Name {...} } i'd like to use list<T>.Find(Predicat<T>) with the property Name of the struct. How can i do so Thanks, This webpage has a C# example. You could use an anonymous delegate instead. If "list" is a List<MyStruct> then the following would work: string name = "Peter"; MyStruct result = list.Find( delegate (MyStruct value) { return string .Equals(value.Name, name); }); I've seen the example but its not enough .... the example use a delegate that ...Show All

  • Leaf. Access Controls or Variables on Other Forms: Part II, Attack of the Forms

    Okay, well anyways, you probably remember I posted a thread about this. But....what if I want to access the methods and properties on a form that hasn't been launched from the current form. Let's say there is an options form and a customization form, neither of which are the default forms. I want the options form to modify something, such as background color, of the customize form. How would I go about that I used form2 instance = new form2(this); instance.Show(); but I can't do that because they arent laucnhed from one another... the same things would apply as last time. you would create a class, and just access its properties/methods as long as they are declared as public. If its not launched, then thats fine too - you dont ...Show All

  • R_Vogel write data to file, data lost..

    FileStream file = new FileStream(@"C:\test.txt", FileMode.OpenOrCreate, FileAccess.Write); StreamWriter sw = new StreamWriter(file,true); string s = comport.ReadExisting(); sw.Write(s); sw.Flush(); sw.Close(); Q1: when I use StreamWriter sw = new StreamWriter(file); the program runs OK. however, when I add "true" as the 2nd argument to append data to the file, the following errors show: Error 1 The best overloaded method match for 'System.IO.StreamWriter.StreamWriter(System.IO.Stream, System.Text.Encoding)' has some invalid arguments Error 2 Argument '2': cannot convert from 'bool' to 'System.Text.Encoding' I do not know what's the problem... Q2: I read da ...Show All

  • Tomay How can we read the properties of song selected from the fileupload control

    Hi, i will upload one song from fileupload control at this time i would like to read the advanced properties of selected song, advanced properties like Album, Author, Title, Duration etc., of the selected song. How to do this Thanks Vishwanath hi vishwanatha, u may try this: Dim id As ID3V1Tag // this for mp3 //Dim w as WMAID3Tag // this for wma //w = New WMAID3Tag(tbFilename.Text) id = New ID3V1Tag(tbFilename.Text) tbTitle.Text = id.title tbArtist.Text = id.artist tbAlbum.Text = id.album tbGenre.Text = id.genre tbYear.Text = id.year.ToString tbTrack.Text = id.track.ToString tbDescription.Text = id.comment hope this can help you...:) ...Show All

  • Shiva3Al&amp;#33;3n C# Programming->Constructor

    hi Ques when to use the private constructor. can any one explain with realworld examples Some info about "Factory Methods": http://en.wikipedia.org/wiki/Factory_method_pattern And "Virtual Constructor": http://en.wikipedia.org/wiki/Virtual_constructor As Mattew described, before .NET 2.0 if you had a class all with static methods it was a good practice to put emty private constructor, just to help other developers that use the class to not create instance of it, to be able to use the methods. Why, because if you don't have constructor, builder automatically adds public emty constructor. More offen you can be in situation where your constructor ...Show All

  • smalamas Switch statement

    Hi, all: [I guess this could be considered a rant, but I'm still curious if anyone shares my opinion on this] I am still wondering why the switch statement is not more flexible. For example, I feel that a switch statement using objects makes sense. I'll give a more visual example for ease of understanding more than anything else, so picture this: I have three buttons on my form, button1, button2, button3. I set the click event to the same event handler, button_ButtonClick. Inside the button_ButtonClick method I want to check the sender to see which button was clicked, so I do this: switch (sender) // or even (sender as Button) { case button1: // do something here break ; case button2: // do somethi ...Show All

  • Hassan Ayoub propagation of user-type objects through a webservice

    Hello, here is my problem: I have written a webservice with several methods that shall be called by a client application and return data in the shape of a user-defined type. This type contains two string arrays and some numerical information and is defined in a dll. The problem shows up when i want to compile the client; i get the error message: Argument '1': cannot convert from 'Conformity_FTP_Client.localhost.ActualDirInfo' to 'Conformity_FTP_Tools.ActualDirInfo' Here is the critical part of the client sourcecode: Rather than a user-defined type, create an XSD of the request data. Using the XSD.exe tool you can create a designer class from the XSD you create. You can place this class in a DLL that can be used by b ...Show All

  • Paul Burg How to decide who is calling a class library?

    A IE extension wrote with c#, how decide who is the container ( iexplore or explorer ), I found this.container is null Hi, assuming you have used " WebBrowserClass" [lets say obj name is "Explorer"] //after checking READYSTATE_COMPLETE and its true then if (Explorer.Document is HTMLDocument) //if this is IE then it will go inside the if statement and if its windows explorer then it will not { ... your code... } Should work fine, HTH, Thank you for reply, it does work, But in the way we decide it in eventhandle, how to decide it before add event hadler I mean if it's not iexplore I won't add the event hadler. Hi, I am not clear on your question, The following is not usable if (Explor ...Show All

  • Becker2 How to check if .Net 2.0 and SQL EXPRESS is installed?

    Hi I have developed windows application using VC#2005 Express and then I create a Setup file for my Project using VS2003 I want when the user try and install my application to another machine it first detect if .Net 2.0 Framework and SQL EXPRESS is installed so that the application can run properly. is there a way to do this inside C# code or any other way or when you create a setup file in VS2003. Your help will be highly appreciated well, you would be best creating a setup installer in VS2005, as it will install the appropriate framework if it does not exist on the machine however I believe this is one of the limitations in the express editions Otherwise, take a look at this, which will show you the CLR version: h ...Show All

606162636465666768697071727374757677

©2008 Software Development Network

powered by phorum