Answer Questions
bw12117 Component class adding a List attribute
Here is a piece of code from my component class. I am trying to add a List attribute: [Description("The type of the parameter"), Category("Behaviour")] public string Type { get { return this.Type; } set { this.Type = value; } } [Description("List of parameters"), Category("Behaviour")] public List<Fields> AllFields { get { return this.AllFields; } set { // } } Fields is a public class: public class Fields { public string type; public string name; public string value; } My question is how do I Set the value to my List<Fields> Eventually I need to add values to the list at design-time ...Show All
BradyGuy Is there any tool functions as a switch in windows forms?
Hi,as stated in the subject, I want to know whether there is a control acts as a switch. Just like the one we use to open or close the light... Now I can only use two buttons. Each time only one button is enabled and when user clicks the active one, it will become disabled and the other one will be enabled...However, it is not so intuitionistic and a little bit strange... So does C# or visual studio offers such electrical tools Or I have to draw one by myself Is there any resource supplied for electrical GUI online Thanks a lot! Thanks James! I have no idea about GDI+ or OnPaint() method... I will try to search around and find the solution. I was bored today, so I did it myself..... .csharpcode, . ...Show All
Srikanth.P C# & Franson GPSTools SDK
Hi Guys, I am trying to get a fix from a GPS using a SDK called Franson GPS tools. http://www.franson.com/gpstools I have gotten quite far on my own but am stuck - when I create a instance of class called GpsFix i get a compile error that no constructors are defined. It appears to me that I must set the position property of gpsfix before I use it A little confused here. But I also see that position is a class in itself My code is below. If someone can see where I am going wrong please advise. As a first go at using this SDK all I am trying to do is get a fix from the GPS. Thanks heaps. -Al using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using ...Show All
Best Ordinary Man Generic Base Class/Retaining Previous Version of An Object
I have the following base class: using System; using System.Collections.Generic; using System.Reflection; namespace CharlesLaboratory { public abstract class EntityPreviousState<TEntity> { private TEntity _previousVersion; [NonComparable(true)] public TEntity PreviousVersion { get { return _previousVersion; } set { _previousVersion = value; } } private bool _deleted; [NonComparable(true)] public bool Deleted { get { return _deleted; } set { _deleted = value; } } /// <summary> /// This method returns a set of key/value pairs that contain the names and values ...Show All
shihad CodeDomProvider.CompileAssemblyFromFile(..)
I have a little program compiled by CodeDomProvider.CompileAssemblyFromFile(..) method, but it alaways show a console window when runs, I don't know what makes this happen, Who knows how to eliminate the console window. Thanks. up ...Show All
caltex how to use Microsoft office Chart Control
hi forum please tell me how can i use Microsoft office Chart Control in our .Net applications(Wndows/Web form both). thanking you in advance 1)Create a Windows Application 2) Right Click on Tool Box and Select "Choose Items...." 3) Go to COM tab and select the Microsoft Office Chart Control....Click OK now its added in Tool Box 4) Drag it from Tool Box to your Windows or WebForm Done! Best Regards, ...Show All
Delmer Johnson object [] Args
Hi, can any of you please tell me on how to create the arraay of objects in the format: object [] Args in prder to pass it through InvokeMethod(string, string,string, object[]Args) if possible please write the code example. Regards, Chaman can i use the same procedure for strings what i have done: Object[] Arrstring1 = {"ABC","ghetto"}; InvokeMethod("string", string2, string3, Arrstring1) Here are some code examples about how you can declare and initialize arrays in C#: // Declare a single-dimensional array object[] array1 = new object[5]; array1[0] = 1; array1[1] = 2; array1[2] = 3; array1[3] = 4; array1[4] = 5; // Declare and set array element values obj ...Show All
skt How to use IME(Input Method Editor) in C#?
Hello friends, I want to develop a web application in ASP.Net using C#, in which, we provide a facility to the user to choose any one Indian Language from a drop down list and after that able to enter language specific character. So, plz, help me how to develop such kind of application Can you provide source code for IME (Input Method Editor) that I can integrate it Jitendra Kumar Mehta Here is what you have to do: Host a Windows Forms control in Internet Explorer System.Windows.Forms.Control has a property ImeMode Whether or not this will work at all from within the browser I can't tell but that's what prototyping is for. ...Show All
Kihat Can't read hebrew characters from text file
Hi All, I create a text file that contains hebrew characters and numbers. where I read the from the file to a String parameter I don't see the hebrew characters , I see only the numbers . Hear Is The Code : string sLine = String .Empty; FileStream = new FileStream (sFileName, FileMode .Open, FileAccess .Read); sr = new StreamReader (fs); while ((sLine = sr.ReadLine()) != null ) { sLine += Convert .ToChar(13); // 13 = LF Console .WriteLine(sLine); } Please Help Thanks Boaz Shalev. Hi All, I found this charset appropriate to hebrew : sr = new StreamReader (fs, Encoding .GetEncoding( "wind ...Show All
MSDev23 Convert array to nullable array
Hi, The following code does'nt compil : int[] tab = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; int [] nulltab = (int [])tab; Cannot convert from 'int[]' to 'int [] How I can cast my array Thanx I tried to create the following function but that doesn't works to static T[] ConvertArray<T, V>(V[] array) { T[] nullableArray = new T[array.Length]; for ( int i = 0; i < array.Length; i++) nullableArray[ i] = (T)array[ i]; return nullableArray; } =>Cannot convert 'V' to 'T' Can you help me int[] tab = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; int [] nulltab = (int [])tab; Why do you need a " ...Show All
DavideB Wierd error : Attempted to read or write protected memory. This is often an indication that other memory is corrupt
Ok I have a project that runs fine from the IDE, the problem is if I install the app or run it from the bin\release folder then I get this error on one of my method calls. I have tried this on a test machine and on my development machine and the results are the same. I have spent hours trying to figure this one out....... The crazy thing is, the method shows up in the stack trace but there is not code at all executed in that method. I was having the same problem when trying to instantiate a FoxPro .dll in my VS2005.net web application on the production server. My problem was in the COM .dll itself using a variable GETENV("TEMP"). The problem is that the web app was running as a user via the I ...Show All
jeff w smith Casting Question
I have an ArrayList in which each element contains an Integer. I'd like to convert this to a Decimal Array. So I tried making the conversion like this: (decimal[]) MyIntegerArrayList.ToArray(typeof(decimal)) but it fails. Is there a simple way to make this conversion Robert Gentlemen, Your "ConvertAll" suggestion must require VS2005. I'm only using VS2003. So I guess I'm going to have to write my own conversion method and convert each element, one by one. Oh well, at least I know that I wasn't "missing" something very simple. Thank you for responding, Robert From your ArrayList, you can easily create a int[] with the method you already used. Then, ...Show All
RoobyDoo Converting Double To Integer
Anyone know how to convert double to integer Thanks, Rob Works like a charm Thanks look in the Convert class: int theValueToConvert = Convert.ToInt32( doubleValue ); I was a little confused about what you meant by "real/true," since the direct cast also converts it to a real integer. From MSDN, it seems that Convert.ToInt32 rounds to the nearest even number when it converts, as opposed to the truncating behavior of casting to int. Personally, I have used the direct cast much more often, in the few situations where conversion is required. is it Ok int intnum=(int)doublevalue; well thats just a ...Show All
sureshsundar007 Get system language independent Yes No Cancel Retry Abort string from the system
How to get the string that represents the "yes" string on the local system. If I use... DialogResult .Yes.ToString() "Yes" is always returned. This is good for English systems. But I want it system language independent. On a Dutch system, it should return the string "Ja". I can work with a resource file, but I think it is possible to get these string directly from the system. But I don't know how. Anyone has the code Thx Adriaan The "Yes" in DialogResult is an enum. ToString() will always return the name of the enum; which is why you get "Yes"--just as you would always get "Win32Windows" when using PlatformID.Win32Windows.ToString(). Currently that is not l ...Show All
vins1972 why i am getting this error?
why i am getting this error ! System.NullReferenceException was unhandled Message="Object reference not set to an instance of an object." Source="my2connectHR" StackTrace: at my2connectHR.frmAddLeave.btnAddLeave_Click(Object sender, EventArgs e) in C:\Documents and Settings\jassim\My Documents\Visual Studio 2005\Projects\my2connectHR\my2connectHR\add_leaves_form.cs:line 81 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Fo ...Show All
