|
I would like to build a Imperial to Metric converter program like the many I have seen on the web. I would like to use this project as a way to better understand C# object orentation, building classes etc. In particular the "front-end" engineering and design aspects.
I have read many books on C# programming but I'm still not feeling like I am concepually putting my programs together efficiently.
Can some one point me into a good source of information on this subject.
tia
rafone
Statistics are like bikini's...
What they reveal is astonishing ...
But what they hide is vital ...
|
|
|
|
|
I am studying a TreeView implementation.
The TreeView uses classes which encapsulate certain controls such as textbox, checkbox etc.
Each item class inherits from Component (not Control).
Generally speaking, why would you inherit from Component like this?
|
|
|
|
|
Hi,
I would inherit from Component, not from Control, to get objects that can be inserted and configured with Visual Studio Designer, without them being Controls, i.e. actual GUI parts. Some examples are:
System.IO.Ports.SerialPort
System.Windows.Forms.Timer
System.Timers.Timer
see MSDN[^]
For GUI parts I would derive specialized Controls from their typical original (e.g. a special TextBox from TextBox) and composite Controls from UserControl.
|
|
|
|
|
When I'm a bad developer. Fortunately, as a good developer, I don't derive from either those; I implement appropriate interfaces instead.
There are many places within .net where inheritance was used when interface implementation would be more appropriate.
|
|
|
|
|
Hi I am struggeling with a print problem since a while.
I want to print the content of a Panel thats sits in a form. The panel has a dynamic number of labels in it.
I have tried with both crystal reports and the Visual Studio PrintForm powerpack but it is not what I am looking for.
Has someone got a best practice or any hints for me. Completing my first c# course at Uni so I am quite new at it.
Thanks in advance
|
|
|
|
|
Here[^] is one way of doing this.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Hi.
can u tell me how can install Crystal Report When i am installing my project to another computer(With Install Shield)?like .Net FramWork.
When i install my project to user's computer this message is shown.
Could not Load or find assembly 'CrystalDecisions.Windows.Forms,Version=10.5.3700,Culture=neutral....'
But i did add this refrence to my project.
Thank u.
CanI
|
|
|
|
|
Is that file present at the same location in the user computer as you have set in your code?
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
I can't find that file in my computer too!!!
I have installed Crystall Report in user's system but it isn't working yet.
(I added that Assembly in my C# program And Built it.(Release it) and in my install Shield project i added all files from Release Folder).
Did i do any mistake?or should i do anything more?
Thank u.
CanI
|
|
|
|
|
The error message says what you need to so. That file is not there on the computer. So update your setup such that the file is copied to the user computers while installation.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Now i have form1 and form2
datetimepicker1 and datetimepicker2 is in form1
i want to use datetimepicker1 and datetimepicker2 on form2 from form1,set datetimepicker1'modifiers and datetimepicker2'MOdifiers to public on form1, i wrote my code on form1 like this string from, to;
from = this.dateTimePicker1.Value.ToString("yyyy-MM-dd");
to = this.dateTimePicker2.Value.ToString("yyyy-MM-dd");
it can work very well
then wrote my code on form2 like this
Form1 frm=new Form1();
string from, to;
from = frm.dateTimePicker1.Value.ToString("yyyy-MM-dd");
to = frm.dateTimePicker2.Value.ToString("yyyy-MM-dd");
when i run my code ,from=2010-01-09,to=2010-01-09 on form2
but when i select dateTimePicker1=2010-01-05, dateTimePicker2=2010-01-09 on form1,
then run my code ,it shows from=2010-01-05,to=2010-01-09 on form1,but it also shows from=2010-01-09,to=2010-01-09 on form2,it do not change anymore on form2,i think it may be read from the most beginning.
i want to get the changed dateTimePicker.Value,how could i do
thanks everyone?
|
|
|
|
|
Can you post the actual code, rather than your synopsis? I have some thoughts about what may be happenning, but I don't want to lead you astray by guessing. Copy and paste the code for both forms in your reply, then highlight all of it and click the
code block tag above to preserve your formatting.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
miss YY wrote: set datetimepicker1 and datetimepicker2 modifiers to public on form1
Not necessary and not a good idea
miss YY wrote: on form2 like this
Form1 frm = new Form1();
This is the clue! This is a new instance of Form1 (i.e. not the same one as you are viewing) so the DateTimePicker s are not the same ones and therefore have different values.
Where is form2 created - in Form1? If so, keep a reference in Form1 to the new Form2 . In Form2 , create properties or methods to receive the DateTime s, and set them from Form1 when they change using the reference you already have.
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
miss YY wrote: Form1 frm=new Form1();
string from, to;
from = frm.dateTimePicker1.Value.ToString("yyyy-MM-dd");
to = frm.dateTimePicker2.Value.ToString("yyyy-MM-dd");
Since you haven't shown the form, the user hasn't had a chance to change the values. "new" does exactly that: creates a new instance of Form1. If you have an existing instance of Form1 that the user has allready selected the to and from dates on, you need to access that instead.
All those who believe in psycho kinesis, raise my hand.
|
|
|
|
|
Create a static class that holds the DateTime objects, and simply refer to them from both forms.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
So, I want to make an address book like database for all the plants I encounter. I am going to sort them in a list by scientific name and when I click on one of the names it will show a picture I took of the given specimen in a large picturebox next to the list. Then when I double click on the name of the plant, a new window will open showing multiple pictures of the plant along with categorical data similar to a contact entry (name, address, city, gender, etc). I am not sure how to go about doing this in terms of storing and accessing the picture files. I am not too familiar with SQL but I have seen some examples of address books using SQL servers on this site. My question is how will i store, call, and manage all the pictures of the given plants in an SQL server? Can you call up pictures as you do text data? Any help would be greatly appreciated!
|
|
|
|
|
There are many ways to handle photos in SQL Server, so do a little research. Photos are usually treated as Binary Large Objects (BLOBs) in database parlance, so try searching Google and MSDN, as well as the database forum on this site. The short answer is yes, you can use photos just like any other data, but there are efficient ways to do it and innefficient ways, as well. I'm not an expert on this, not even a beginner, but I have read a lot of discussion about this type of database, and I recommend that you do so before you spend too much time chasing butterflies.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
You have an even more fundamental question to answer before discussing the database and how to store your data. What is the client you are going to use, winforms/wpf or web/silverlight. This will be determined by your audience.
If your project is a personal one then winforms may be the best solution. With SQL server you have a number of choices of how you store your data, you may want to store the actual file in the database or filestore (SQL 2008) or you may want to leave the file in the file system and store it's location in the database.
If you are using the web this is critical as your database size will be DRAMATICALLY different and it will affect your hosting choices.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Personally, I prefer to store such files within the database.
|
|
|
|
|
Hello every one
How I can set the Contextmenustrip for root and disable some items of Contextmenustrip for Children.
I fill tree with an Xml File.
if (treeView1.SelectedNode.Level == 0)
treeView1.SelectedNode.ContextMenuStrip = contextMenuStrip1;
if (treeView1.SelectedNode.Level == 1)
treeView1.SelectedNode.ContextMenuStrip = contextMenuStrip2;
modified on Sunday, January 10, 2010 1:34 AM
|
|
|
|
|
I'm lookinmg for a simple C# program using the DDay.Ical library that adds Attendees both optional and required to a meeting request.
I've seen how to add the email for an attendee in addAttendee method. How do I make it required and optional?
|
|
|
|
|
|
Hi everybody,
I have this abstract method:
public static T DecodeData<T>(byte[] data, string encRules)
But the type T must be defined during runtime. I mean... I have other method like:
GetDownloadType(id);
Depend on the id, I should pass one or another parameter to DecodeData. But I dont know how.
public static Type GetDownloadType (int id)
{
switch (id)
{
case DOWNDIRECT: return typeof(DownDirect);
case DOWNOTHER: return typeof(DownOther);
case DOWNHEHE: return typeof(DownHehe);
default: return null;
}
}
But when I try to use the Type result of this method to pass it to DecodeData... I cant. How should I do this?
Thanks in advanced
|
|
|
|
|
T needs to be resolvable at compile time i.e before runtime when you have access to the type via typeof
Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
The type things used in generics are not instances of Type
But of course you could put the calls to DecodeData in that switch (and some code that uses its result too, perhaps, otherwise you may get a similar problem with the result type)
|
|
|
|