By the way, is there a way to "shorten the patch" to the singleton ? I mean, I have to write right now MainMameSpace.MyClasses.PropertiesClass.Instance.SomeFunction, but it would be much easier if it could be just MainNameSpace.PropertiesInstancel.SomeFunction.
Isn't it possible to access the ProperitesClass.Instance through a pointer or something ?
At the top of the file you can add using statements so that you can short circuit the path to the classes. If there is any ambiguity, for example two classes with the same name but in different namespaces, you will still have to use the full path.
then later in your code you can just put:
C# only permits pointers in unsafemethods. However if you are going to use the instance a lot then you can just assign it to a variable as normal. e.g.
hi, im using a datagrid generated from a XML file using the VS XSD builder. now i want to add a "virtual" colum that add's some extra information, i only need this information on the runtime so i don't wanna add it to the XML file.
i have read some examples with "BindingContext" and "Expression" but this examples are mostly DataGridBoolColumn and no TextColums.
dose anybody knows a tuturial or have some example code?
First, you should consider using DataGridTableStyle(s) to control exactly what the user sees (for instance, if you have a PK in your strongly-typed DataSet as a numeric type, users probably don't need to see that). This will allow you to add columns that aren't bound to the DataSet as well.
i am try to do like this ....
i have a win form textbox and i am trying to write something like "jacal99" using threading with five seconds interval .... the value of thread was thread.sleep(5000);
but when the next charactor try to print in the textbox the first value gone.
i want to pring "jacal99" with five seconds interval .... every charactor...
Hi again. Still learning C#. This time I managed to create 2 similar controls. I also have a class PropertiesClass that should change some properties (like color and text) of the controls. But after I have changed a property in PropertiesClass, how can I let the other (two) controls know that I did it ? I remind You that I have several controls that must be updated, not just one. I guess the only chance would be using events somehow ?
From my Borland Delphi days I remember using messages (if property is changed I broadcast the message and the controls respond to it) for things like this, but unfortunately (or luckily) .NET doesn't support them...
I'm very new to C# and I have some questions about writing my own controls (I thought I can learn it best that way). I have two classes - one containing a procedure that paints a area (draws a custom 3D border and background) and another class is a control, witch must call the painting method (that is in the first class) in OnPaint method.
What I don't understand here is how can I pass the area of control as a parameter of the method?
Like in Borland Delphi I would have done it like this:
procedure PaintControl(AreaToPaint: Rect)
Or with two points (one x1, y1 and another x2,x2).
How can I do this in C# ?
If you understood even a little what I'm talking about, please reply....
I am an ex VB programmer learning C# by converting a VB app into C#. In VB I was able to add properties (get and set) to a form so that you could set some properties, display the form so the user could do their bit and the hide the form to read the properties and then close the form.
Is it possible to add properties this way in C#?
I would need to call the form and set the form properties from a button click procedure.
It looked pretty close and so I placed it into the form but I was unable to access the property from my buttom click event. How can I make the property so I can access it from the property click event? What I want to achieve ( using the example given) is frmMyform.MyPropertyName = value;
I am trying to create a download program similar to flashget but I have come across a problem. Some of the files as you would know are retrieved by using ftp and others http. I have had no problem to download either of these but I found some download links are http to start off with and then are redirected to ftp. Here is the code I am using for http downloads: