|
What about TabControl with TabPages?
All the best,
Martin
|
|
|
|
|
Based on this can i ask how the option forms with a listview changing the panel on the right are designed? SOmething like e-mule options?
I know how can it be done, i just want to ask how they visually design it. Can a form be placed inside a panel for example?
|
|
|
|
|
hey guys, currently I'm working on a project for myself that contains alot of entery forms that are basically the same (text boxes, code ...), but of course they each are connected to different tables and they have different names, so I want to creat one and just duplicate it for the others (just change some names !) I tried to use Inherited Forms but I couldn't change anything there ! can you give me a hint !
Thanx alot
Mr.K
|
|
|
|
|
Hello,
Seem that your controls on the base form are private members.
You could change them to protected or public than you would be able to change their properties.
All the best,
Martin
|
|
|
|
|
Maybe you dont need different forms at all, you might just come up with one that adapts itself
to a range of requirements, and then you create many instances of it.
Once you get it to work, it would save a lot of code and hassle, and it may open up a range of
new possibilities too.
I got used to create most dialogs programmatically, my typical application has only two forms
that resulted form Visual Designer: the main form, and the About form. Everything else, I
tend to program (based on some dialog classes I created over time, and keep expanding when
the need arises).
Luc Pattyn
|
|
|
|
|
OK, I am really stuck.
I have a form with a button. I click the button and I want to display a dialog box.
I created the dialog box using the age old inheritance stuff. That is:
public class MySpecialDialog : System.Windows.Forms.Form
I customize the form to my hearts content. Glory be. How simple can this be?
But when I try do instantiate this customized dialog:
private WindowsForms.MySpecialDialog aDialog;
aDialog = new MySpecialDialog();
and then show the dialog in the button click routine:
aDialog.ShowDialog();
I get a form that is just a blank form.
Could someone tell me what I am missing here?
Thanks in advance, Vern
|
|
|
|
|
Is the dialog of type dialog?
Also make sure the constructor calls the InitializeComponents method of the WYSIWYG part won't work right. Also ...
<br />
if(aDialog.ShowDialog() == DialogResult.OK){}...<br />
will let you use it.
File Not Found
|
|
|
|
|
Ennis:
Thank you very much for your response. Calling InitializeComponenets in the constructor did the trick. I really appreciate your help.
Vern
|
|
|
|
|
Also, for future reference, the VS Desiner will often drop events on accident. So if your controls ever stop responding to user events check the events list.
File Not Found
|
|
|
|
|
I do believe I know what your talking about. I remember working on a project where I know I had an event handler and one day it was just gone. Now I know it was not my imagination.
Thanks again.
|
|
|
|
|
Ok, thanks to some help, I think I have what I need to extract the data I need from a HUGE (900Mb-2Gb) text file.
Now I need to store the huge volume of data so that I can process it. Its only 5 fields, but lots of entries. I will need to group the data based upon various fields so I can bin and plot it. I will also need to do things like MIN/Max/Average of one field for groups of another field.
So the question is what type of data structure do I put it into? Any suggestions?
David Wilkes
|
|
|
|
|
amatbrewer wrote: So the question is what type of data structure do I put it into? Any suggestions?
A database. It is designed specifically to hold and process large volumes of data like this.
|
|
|
|
|
and with several gigs of data, that DB should be something other than access.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
Ie every time your app runs the data is different I wouldn't recommend a database. When parsing the national do not call registry I wrote a simple binary search to traverse the massive mulit-gig file to return entries by area code.
Putting it into SQL Server took 2 days. Based on the need and my knowledge of algorithms no db was a better answer.
Of course depending on how complicated you get will depend on when a db becomes a valid choice.
File Not Found
|
|
|
|
|
Ennis Ray Lynch, Jr. wrote: Ie every time your app runs the data is different I wouldn't recommend a database.
Thanks!!! I had not thought of that part. The data will be 100% new each time. I basically need short term data storage that I can build and access quickly, and that is gone once I am done.
We are only talkign about 6 fields (all numbers with one being in Octial format). But the quantity of data is Huge!
I am working on creating an object that will read the file, parse out the data I need, and store it so I can perform functions on the data.
This is an entirely new area for me and I am open to any ideas.
David Wilkes
|
|
|
|
|
Use streams and only persist the results to permanent storage. You may have to fiddle if you havent taken a good Data Structures and Algorithms class but it can be done reasonably fast.
File Not Found
|
|
|
|
|
I am all getting confused. I searched on the net but got more. Basically, when and where do we use class as an Interface, abstract class and static Class or methods. What are the advantages.
I know that Interface doesn't have any implementation it just have methods declaration.
Static class doesn't get instationed.
Thanks
|
|
|
|
|
If you want to define multiple items that must be implemented in a class to guarantee an operation, then use an interface. This means that you can refer to the class that instantiates it without needing to know what the class is. As an example, suppose that you have developed a database agnostic application and you want to read a DataReader, then you could do this:
public class AgnosticReaderImplementation
{
public void Fill(IDataReader dr)
{
while (dr.HasRows)
{
...
}
}
}
This way, the code outside your class could pass in a SqlDataReader, or an OracleDataReader and so on.
An abstract class is normally the base for something else, so it defines the basics (or common options) for your implementations. It is a relatively high-level abstraction that you must inherit from to do something useful. Consider this very trivial example.
public abstract IdBase
{
private string _id = string.Empty;
protected object lockObject = new Object();
private bool _isDirty = false;
public Id
{
get
{
lock (lockObject)
{
return _id;
}
}
set
{
lock (lockObject)
{
Changed(_id, value);
_id = value;
}
}
}
private void Changed(object old, object change)
{
if (old != null && !old.Equals(change))
isDirty = true;
}
public bool IsDirty
{
get {
lock (lockObject)
{
return _isDirty ;
}
set {
lock (lockObject)
{
_isDirty = true;
}
}
}
}
public class DatabaseHandler : IdBase
{
}
This means that in the class DatabaseHandler there certain items that have already been applied by virtue of being in the class IdBase. You can't instantiate IdBase directly, because it isn't really very useful on its own, but it does give you a good base for using in other classes.
Implementing things as static means that you don't have to instantiate a class to call a method. This is useful, for instance, when you want to do something like writing to a log. Suppose that you have a class called Utility which implements a static method WriteToLog, then all you have to do in your code is call Utility.WriteToLog to call it.
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.
|
|
|
|
|
An interface is a contract that a class has to fullfil to implement it. You can write code that uses an interface without first having a class that implements it. This is for instance used in the framework to allow for custom comparers.
An abstract class is a class that you can not instantiate, only inherit from to create other classes.
A static class is just a container for static members. You can use it as a container for things like global settings or factory methods that only create objects of other classes.
---
Year happy = new Year(2007);
|
|
|
|
|
I was wondering. I see how complicated the messages on this board are. That I am wondering where I can turn for my insignificant questions as a programmer who has less than 1,000 lines of code in experience.
I find Visual C# 2005 Express Edition very nice, I got a book about it. And that in my second attempt to make a program to multiply matrices and vectors by operators I got a problem which is so weird because according to the book I read this shouldn't be a problem at all. To write a method to create an instance of a class you use a method with the same name as the class, simple, but I got the error message that it wasn't allowed because it caused a name problem.
Wouldn't it be a good idea to add to this board a group or category for beginners?
Ranger
Beginner.
|
|
|
|
|
Well, chances are you would get mostly beginner's replies too.
Luc Pattyn
|
|
|
|
|
Luc Pattyn wrote: Well, chances are you would get mostly beginner's replies too.
Luc Pattyn
That wouldn't be a problem if they knew a solution to your problem...
But that if my program won't work because Visual C# 2005 Express Edition cannot handle it, then you really have a problem as a beginner!
I remember how some two years ago I tried Java and that my programming project at the time didn't work, and that the problem was Java and not my code.
I just installed the SP1 for V C# 2005 EE, that is the least I could do. So now I have just one error left during compiling. Still my program won't run!
What do I do now?
Ranger.
beginner
|
|
|
|
|
Normally, your first port of call when you have an error is to google for it. Get the text of your error and see if others have had the same issue. There will be some false alarms, and some blind alleys here, but this is a fantastic way to learn things because very often somebody will have written something else along the way that you will want to explore.
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.
|
|
|
|
|
As long as the compiler generates errors, your code will not run.
I prefer a short edit/build/run cycle, so I dont add lots of code at once.
That normally avoids adding lots of errors at once too.
If you cant get rid of compile errors, my advice is to disable part of the new code,
this should allow you to run the code, and see how it performs.
To disable some code (that the compiler does not yet like), the easiest way is
to use "#if false" and "#endif" statements (be careful to respect all nestings,
e.g. in the remaining code { and } must still be matched.
You could then:
- either use the debugger capabilities (such as single stepping, watching variables, etc)
- include "log" statements that show intermediate values (either in a Console window,
a listbox, or a file).
Any time you are satisfied with the working code, add some code and watch it in operation.
etc.
Luc Pattyn
|
|
|
|
|
Ranger49 wrote: That wouldn't be a problem if they knew a solution to your problem...
Well... that depends on your point of view. I've seen a beginner ask a question here and another beginner answer it. The answer can range from a little bit off target to so utterly wrong you wonder what on earth they were thinking.
If you have a good mix of people of different skill levels a more experienced person can at least step in and correct the additional problem.
For example: I frequently correct answers on questions relating to databases because the answer, while appearing to solve the immediate problem, open up such a huge can of worms that isn't immediately apparent that I feel I have to step if (if only to protect my self from any application they write that I end up having to interact with)
Ranger49 wrote: I just installed the SP1 for V C# 2005 EE, that is the least I could do. So now I have just one error left during compiling. Still my program won't run!
What do I do now?
Google the error message can work. That is the first thing I do when I don't understand an error (Actually, I use search.live.com[^] these days)
If you still have difficulty then ask on a forum like this. Post the relevant snippet of code and the error message. Remember to include anything that the line is dependent on.
For example: If you have an exception being thrown on a line that reads
myCommand.ExecuteNonQuery(); then that line on its own doesn't mean anything to anyone. You have to include the lines of code that show how the myCommand object was built up so we know what kind of query, what parameters were used and so on. It depends on the actual line of code what you need to include. Also, remember to include the real lines of code. There is no point including something that is similar to the line of code (especially for a syntax error) because then we can't see what is really going on.
I hope this helps you make better use of the forums. We are, on the whole, a pretty good bunch of people that like to help others. But we are more keen to help those that show they are at least willing to try to help themselves first by showing what they've tried, any giving the relevant information. Don't worry if you don't know what is relevant yet, if there is pertinent information missing we'll let you know.
|
|
|
|