|
In the button event for each of the buttons set (or append) the relevant number to the Text property of the TextBox .
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
private void Button1(object ....
myText.Text += "1";
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
How could I design a class like TreeNode, I have tried but I am getting a Object Reference Exception
public class classA<br />
{<br />
public classA(){}<br />
public void INeed()<br />
{<br />
classB b = new classB();<br />
b.Add(string something);<br />
}<br />
}<br />
public class classB<br />
{<br />
private string att1;<br />
private int index ;<br />
private classB[] container;<br />
public classB()<br />
{<br />
container = new classB[100];index = 0 ;<br />
}<br />
public void Add(string addNew)<br />
{<br />
container[index].att1 = addNew;
index++;<br />
}<br />
}
If I do so , am getting a Object reference not set to an instance of an object error
in the line that I try to add something to the container.
Could you explain why ?
And how could I deal with the issue ?
-- modified at 15:24 Saturday 10th December, 2005
|
|
|
|
|
Bahadir Cambel wrote: If I do so , am getting a Object reference not set to an instance of an object error
in the line that I try to add something to the container.
Could you explain why ?
Bahadir Cambel wrote:
container = new classB[100];</code></blockquote>
That <code>new</code> just allocates the space for the array elements. It doesn't instantiate the 100 objects; you have to do that yourself.
<pre>public void Add(string addNew) {
container[index] = new classB(); // my addition.
container[index].att1 = addNew;//causes error
index++;
}
If you don't actually want exactly 100 elements (did you just pick an arbitrarily large number...?) you should use a dynamically sized container, like an ArrayList , rather than an array. Just my 2 cents...
Share and enjoy.
Sean
|
|
|
|
|
Yes it was a arbitrarily large number.
Thanks for you replay , it solved my problem.
Bado
|
|
|
|
|
why not just use the add method to add your object.
Try extending the IList Interface. It will help you
class MyClass : IList
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I'm quiet new in c#, Now I'm try to develop a HR management program and this application need to have a report to show and print out to user, and there are more than one type of report that available for my user to choose, all the user have to do is just choose which report he/she like, So I want to know is there any easy tool to do a report? I try to use crystal report but I have to make a file name .rpt but in my case I need many report ,so do i have to make many .rpt file? or is there any other way to implement this? And can i use sql command with each report? if yes how? Please give me some suggestion . Thanks... I use VS.Net 2003 And SQL Server 2000 .
|
|
|
|
|
do crystal reports or something.
You can use the printing namespace but would take forever
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
I would like to know why we write this formula to change from color to Grayscale picture
The formula is p[0] = p[1] = p[2] = (byte)(.299 * red + .587 * green + .114 * blue);
thanks in advance
haitham
|
|
|
|
|
The different colors have a different brightness, red and blue are perceived darker as darker colors. I assume it has to do with the fact that red and blue are on the ends of the visible spectrum while green is in the middle.
regards,
rob tillaart
|
|
|
|
|
i know that this code convert the perceived bytes of the RGB to be within the domain 0-->255 and the rgb saved as 24byte per pixel i.e 3 * 8 bytes in other words red take byte blue takes byte etc so my question why we multiply the red color by the number (.299) specifically and of course the remaining numbers
thanks for ur attention.
haitham
|
|
|
|
|
Converting a image to a grayscale has no standard. Mostly on the internet you will find this forumla givven by the NTSC standard
GS = 0.3*R + 0.59*G + 0.11*B
These scaling values (0.3, 0.59, 0.11) can variate. Their main purpose is to sum up to a property (luminance) of the givven color. The final color is from the grayscale because you set all the 3 bytes to the same value.
Try using other scaling values in your ConvertToGrayscale procedure and observe the diferrences.- of course that the standard values haven't been found through experimentation, a good image processing skil is required and if I m not mistaking phisics is needed too in order to get to a such result.
protected internal static readonly ... and I wish the list could continue ...
|
|
|
|
|
|
You know they provide an imaging namespacing to do this math so as specifications change your code will not.
And the Color object can convert values for you
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
DO u mean that the color object consists a method to convert the picture from color to grayscale or any specific format?
i didnt try it yet but i think that it will be slower than we handle this ourselves
thanks for ur help
haitham
|
|
|
|
|
no,but there is an imaging namespace that would be more effecient, unless you do the processing in C++
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
how can i know the capabilities of the imaging name space
and i want to know also if there is any book talk about the image processing in c# or handle the image processing methods of matlab in c#
thanks in advance
haitham
|
|
|
|
|
a link to using matlab http://www.codeproject.com/dotnet/matlabeng.asp[^] in c#
Just create an image and use the System.Drawing.Imaging namespace.
Use your Object Browser to view the objects you can use.
Nick
I'm not an expert yet, but I play one at work. Yeah and here too.
|
|
|
|
|
hello everybody..can someone help me in finding the source code in c# for my major project..my topic is "IMPLEMENTATION OF VIRTUAL PRIVATE NETWORK USING LOGICAL TUNNELING"..actually i found a software on net similar to my project..the name is AccessPoint SSL VPN software..but i am not able to download the toolkit version 1.1 from freedownloadscentre..can someone please help me out..thanx in advance..God bless u all..
spider
hi guys i am spiderman
|
|
|
|
|
I would have thought that VPN software would more commonly be found lower down than C#. I would have said that implementations would most likely be written in C or C++ and be written as a driver rather than in a high level C# application.
My: Blog | Photos
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucious
|
|
|
|
|
|
|
In Windows forms application, while using Combobox, is that possible that I use text to display while in background for storing those values, i use numeric values and vice versa?
Thanks,
Sandeep
+919891027854
|
|
|
|
|
I'm not 100% sure, but I'd take a look at the DisplayMember and ValueMember properties of the ListControl that might be what you're looking for.
- Aaron
|
|
|
|
|
Yes, I am looking for the same . But how can we use this property in a Combobox?
Thanks,
Sandeep
+919891027854
|
|
|
|