|
Wht actually do you want to do?
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
I got a generic error while saving a image
code
img.save(path);
"a generic error occurred in gdi"
please help!
|
|
|
|
|
Pls give some more info .....
Regards,
Bhupi Bhai.
|
|
|
|
|
Wrap this in a try/catch block, and see what exception is being thrown. Check the InnerException to see if there is any useful information there that could help.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I used to use control arrays in VB6, now I am using C#, how can I achieve the same ease of use of several controls on the screen at the same time. I need to have a grid of labels/text boxes where each column acts as a 'control' array.
|
|
|
|
|
As far as I know, you cannot do it in the designer. Buy you can do it by code:
Label[] lbls = new Label[10];
for(int i = 0; i < 10; i++)
{
lbls[i] = new Label();
lbls[i].Text = String.Format("Label {0}", i);
lbls[i].Top = 100 + i * 24;
} You can also subscribe an event for all the controls, using the same handler. And you can use the sender parameter in the event handler to know which control raised it.
I hope this helps!
|
|
|
|
|
Thanks for the response.
I tried the code in the new windows app, no labels appeared on the form even when I set visible to true. Is there something I am missing not doing?
|
|
|
|
|
You have to add the controls to the form:
this.Controls.Add(label[i]) or
label[i].Parent = this; I am assuming that you are calling this code inside the form (because I am using this ).
Also remember to set the coordinates of the labels so that they lie inside the form.
|
|
|
|
|
Mehmet Esen wrote: are there anybody knows (java) dataset equivalent in c#?
I don't know about java dataset. In C# ADO.NET DataSets are used. Here are some links about this, hope this help.
ADO.NET DataSet[^]
Some more Links[^]
Regards
________________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
sory it was a hard day i made a mistake it wasn't dataset it was datahandler (
|
|
|
|
|
Hi All,
I have Visual C# express 2005 properties - Publish - prerequisites set for Download prerequisites from the same location as my application. also the ,NET framework 2.0 and the windows installer 3.1 checked because I don't want the user to have to download them from the internet. (too slow for dialup) I want to publish the app. to CD or DVD with all the necessary files on the cd or dvd and to install them on the clients computer when the app. is installed. I also have some resources files (audio & pictures) that are in the resources folder for the app.
The errors that I get when trying to use the Publish Wizard are several, the first being "Cannot publish becasue a project failed to build." If I just build or rebuild the project, the build succeedes just fine?
the second error, The install location for prerequisites has not been set to 'component vendor's web site' and the file 'DotNetFX\instmsia.exe' in item '.NET Framework 2.0' can not be located on disk.
there are a few more errors also delaing with .NET Framework, if I can get this one fixed, the others will get fixed at the same time.
It would seam that I don't have a path or directory set correctly, but I have looked at everything I can find. But can't figure it out.
Thanks,
|
|
|
|
|
I have the same question like you, I can't make my c# application,to a package contains pic and some xml files config for my application! I suggest you use other tools package your application Because Only the visual studio.NET can do this.
|
|
|
|
|
I got a question.
i am new in this things so
How do you get to the properties of een instance in an arraylist.
And it can be different kind of objects in the arraylist.
|
|
|
|
|
I cannot get your first question.
Arraylist can hold any kind of object. But for a particular instance, it should hold the same kind of object, ie., if you are keeping a string, you have to keep only strings, or if it is integer, you have to keep only integer.
Pradipta Basu
|
|
|
|
|
example
object motor()
object window()
Arraylist carParts
carParts.add(motor)
carParts.add(window)
now i wanna get to the properties of the objects motor and winow in carParts.
I wanna change value in those objects.
|
|
|
|
|
foreach(object part in carParts)
{
if(part is motor)
(part as motor).Cylinders = 12;
if(part is window)
(part as window).Electric = true;
}
Cast it to access the properties.
Or store the object to a new variable.
For instance:
Motor newMotor = null;
if(part is Motor)
newMotor = (part as Motor);
if(newMotor != null)
{
}
-Larantz-
|
|
|
|
|
or, without looking up type of object twice:
Motor newMotor = null;
if((newMotor = part as Motor) != null)
{
}
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
or, without the confusing assignment-and-cast-plus-equality-in-one
Motor newMotor = myArrayList[0] as Motor;<br />
if(newMotor != null)<br />
{<br />
<br />
}
|
|
|
|
|
IMHO it's just about as confusing as ternary operator.
btw, I don't see why would you comment what standart C# operator as does?? Oh wait, maybe because from
... some lines...
if(newMotor != null)
{
}
it's not immediately clear that you are not testing for null, but for type of object...
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
AS is just a no-exception cast. If the cast object is not of the casted type it returns null. Perfect if you want to cast and read a property.
|
|
|
|
|
CP ate my response
I know what as *operator* does, thank you. However I am missing your point.
"Throughout human history, we have been dependent on machines to survive. Fate, it seems, is not without a sense of irony. " - Morpheus
|
|
|
|
|
Hi there,
Anyone please tell me how to code to extract and compress .grf files as done by a program called GRF Tool. I found source code for the app but it was written in C++. I would like to know how to do so using C#. If anyone has any resource, please kindly provide it to me.
Thank you very much.
KiT
|
|
|
|
|
Hi Guys
I am relative new to Visual Studio... I'm about to do some calculations on my data and I was wondering if anybody can tell me the difference between choosing a Windows application or Console application when starting a project and what is the difference. Seems to me, to be easier to implement my algorithms in a console, because it is possible to get the data output in the commando-prompt (don't know how to do this in an application) and later on when designing the GUI I could change it over to an application, is this possible..?
Thanks in advance
AL
|
|
|
|
|
Not good design. That was applicable if the GUI would take a lot of programming, but now in C# all you usually do is drag/drop.
you want to display your output. It could be as easy as:
MessageBox.Show(MyOutputString);
or
MessageBox.Show(MyOutputInt.ToString());
Another way is to show it in a TextBox control:
MyTextBox.Text = MyOutputString;
You usually make a consol application when you don't need a user interface. e.g. a command line tool. If you will need a user interface, you should start a windows application from the beginning. If you don't know how to make a user interface in C#, learning it would be as easy as reading a comic book. Either grab a book, or screw thing up yourself with the designer till you get it right -I don't think it would be that way-. You can even download some free video tutorials on that from the net.
Regards
|
|
|
|
|
ComCoderCsharp wrote: Windows application or Console application
There is no major difference apart from the fact that in a Console application the console is displayed. In a windows one you can write stuff to the console (standard input / output / error) but nothing will be displayed or read.
ComCoderCsharp wrote: Seems to me, to be easier to implement my algorithms in a console
It doesn't really matter, displaying the data initially might be easier with a console.
ComCoderCsharp wrote: (don't know how to do this in an application)
The simplest solution would be to drop a textbox onto the form and append data to that using the TextBox.AppendText method.
ComCoderCsharp wrote: later on when designing the GUI I could change it over to an application, is this possible..?
Yes, just open the property pages and change the output type to Windows Application rather than console, all this does is change a command-line option when calling the C# compiler.
I have no idea what I just said. But my intentions were sincere.
|
|
|
|