|
Hi,
I'm doing a course of C#/ASP.
Getting my head around c# syntax is relatively straight forward
But the framework is set up with a namespace + class for every eventuality.
Once you know the class, then there are a set of static and dynamic methods that you use to do whatever you want to do.
How do most people get their heads around it. Is it about frequent use ? Clever spreadsheets or summary books?
All thoughts appreciated ?
Thanks
|
|
|
|
|
No. Just Google. Look for: MSDN classname.
Most often the first hit is the MSDN documentation page on the class you want, and it lists the namespace, as well as the DLL you need to reference.
|
|
|
|
|
Object Browser. If there is something you expect exists but you don't know the name of it, add some references to the most likely System assemblies and just use the object browser. That way you also see a lot of other classes along the way which may stick in your memory for the next time.
|
|
|
|
|
Seriously, I just search on the internet for the namespace of the class I am working with.
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
Visit the Hindi forum here.
|
|
|
|
|
Smon the Vidd wrote: How do most people get their heads around it.
They don't. One doesn't learn "all the classes" in the framework by heart. Not only would it be a lot, it wouldn't be efficient.
Learn the basics and research specific tasks that you want to implement. Whether it's writing a file, or manipulating a stream, you'd guess that you'd need something from the IO namespace. If you didn't, you'd find it with a quick Google, or on MSDN.
Then you'd need to be able to translate that documentation to the context of your code. That's why you'd need to learn the basics.
Smon the Vidd wrote: Is it about frequent use ? Clever spreadsheets or summary books?
By doing, and hanging around on this site
I are Troll
|
|
|
|
|
for C# express visual studio 2008
i have SQL server local database and
i want connect this database to my windows control..
like textbox , combobox , listbox etc..
i want perform following operation like
insert , update, delete,
movefirst, movelast, moveprevious, movlast
please explain how can i do step by step...
from creating database to distribute
give me sample
thanks ...
jignesh
|
|
|
|
|
I think you're better of googling for a tutorial or on article on this matter than asking about it here.
|
|
|
|
|
Keep the data access methods away from the GUI.
|
|
|
|
|
PLEASE HELP,
All of the sudden, EVERY control on my winform has gone.
All of the files and source code are still there for all controls, and the program compiles and runs, but every single control, other than the menu bar have gone.
I have tried to reseach on the net, but I cant seem to find out what is going on.
Please does anyone know what I may have done.
Thank you
Steve
|
|
|
|
|
stephen.darling wrote: Please does anyone know what I may have done.
No. I trust you're capable of unthinkable things.
Here is a suggestion (after you have made a backup just in case):
- open your main (or only?) Form in Visual Designer
- click the Form
- watch for the Properties pane, it should now show the properties of that Form
- on top of it is a ComboBox listing all the Controls (and Components) that sit on that Form; pick one, say a pretty large one, maybe ECGdisplay
- now the Properties pane shows its properties, which you can edit by clicking and typing all inside the properties pane.
- check the Visible property, check the Size property, check the Location property
- if that doesn't help, check you didn't accidentally cover up everything with a huge object, say a Panel: click somewhere and watch what the ComboBox now shows.
Happy hunting!
BTW: when a reply is pretty good/pretty bad, it wouldn't hurt if you voted it up/down. That is how people get their reputation updated after all.
|
|
|
|
|
Hi Luc,
Well that didnt help (God only knows what Iv managed to do )
Thank you anyway, and as for the voting, forgive me, I didnt realise.
Ill do that from now on.
Thank you
Steve
|
|
|
|
|
stephen.darling wrote: that didnt help
That is not very informative.
Are the controls still listed in the ComboBox? if so, it must be some minor detail.
If not, all may be lost indeed. Unless you have more than one Form (maybe accidentally) and are looking at the wrong one.
You could close VS and restart it.
Or even close VS and reboot.
If it was a bug in VS, that would probably solve it.
It it was you doing something very wrong, that would most certainly further reduce your chances.
|
|
|
|
|
I have restarted VS, all is the same.
I have only one main form, with 2 picturebox controls, a tab control, main menu bar, status bar, and my ecg display.
The main menu and status bar are still there.
All the code appears to be unchanges, and the program compiles without any errors.
All of the controls are listed in the form.resx.cs file, and I tried to add this.addcontroll code manualy like was sugested after searching on the net but this just raised may errors so I deleted the lines.
This has me realy baffled, it happened suddenly and I had not placed any control or code, I simply ran the program.
Steve
|
|
|
|
|
If you're in Belgium right now, you get up real early man...
V.
|
|
|
|
|
Since it compiles and I guess you use your controls in code, the controls should still be there. After all, if your textbox1 is gone in the designer, the code will not recognise the variable in code and will consequently not compile.
I think Luc is right and probably you moved your controls of the dialog (check by making it larger) or you have the size on 1 pixel or something.
You can do several things I think.
- Open the [myform].designer.cs file and check if the variable of your control is defined, I think all the properties are set right after the declaration so make sure to check for errors there. Changing the designer.cs is not an option, your designer will overwrite this file.
- Try setting some properties of your control to valid values (location and size). I don't think Visible is a problem here, because you should still see the control in the designer, it only becomes not visible at runtime.
- I'm not sure if it is possible, but since menu is the only control there, the controls might have ended up behind it, or like Luc suggested you have a panel or something similar on top of all controls. Do you create/add/change controls in code?
Good luck.
V.
|
|
|
|
|
Hi.
Nope, All controls are set to their original sizes (as shown in properties)
Also, I did not select, move or add any control when it happened, and were talking about 7 or 8 controls in total all dissapering at the same time.
Aw well, I have re-designed the form and put this one down to experience. Back up from now on...
Thank you for the advice though!
Steve
|
|
|
|
|
Did you drop a control, say a Panel, on the form covering up the controls?
|
|
|
|
|
I had this happen a couple of years ago (using VS2005 IIRC) and it was a change I made to a menu item that was screwing things up. If it's not too big it may be worth posting the contents of your form's designer.cs file
|
|
|
|
|
No guarantees, but try this:
0) Exit VS2008.
1) Copy the csproj file to a safe location
2) Delete the csproj file from its original location.
3) Start VS2008
4) Load the solution.
See if that doesn't straighten things out for you.
If that doesn't work,
create a new project and copy all of the files from the old solution to the new one (and don't forget to re-add them to the solution).
.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
|
|
|
|
|
There seems to be a bug in Visual Studio which causes this. It happened to me a few months ago, and it took me a while to find a way to fix it.
Things like this emphasise the good practice of having backups We were using PerForce so I could at least get everything working again quickly, but doing the same edits caused the same problem every time. It looks like it's been reported in versions from 2003 onward, but still no fix...
I eventually found the solution after a bit of searching. I can't find the link at the moment, but I think it was something I had to edit in the "whatsit.Designer.cs" file, and possibly deleting one of the VS temp working files. If I can find the link I'll add it here.
Days spent at sea are not deducted from one's alloted span - Phoenician proverb
|
|
|
|
|
This happened to me once. After some frantic hacking, I eventually discovered that I had eliminated the call to InitializeComponent() in the class' constructor.
|
|
|
|
|
Sorry to post again so soon.
My following overriden ondraw function draws a graph
protected override void OnPaint(PaintEventArgs e)
{
if (machineStatusON)
{
for (int i = 0; i < ECGArray.Length; i++)
{
if (x > this.Width) x = 0;
x += 1;
px = x;
p = 60 - (ECGArray[i] / 3 + 50);
e.Graphics.DrawLine(yelgpen, px, pp + 30, x, p + 30);
e.Graphics.DrawLine(blackpen, x + 1, 0, x + 1, this.Height - 1);
pp = p;
pq = q;
pr = r;
}
}
}
As you can see, it uses ECGArray, but, I have a number of different arrays representing different graphs.
How can I setup my OnDraw() to display a different graph, based on what info is passed into my ecg object at runtime?
Thank you
Steve
|
|
|
|
|
You have been getting a lot of help here but honestly ask yourself, is this project beyond you?
If you are creating an application to draw seperate graphs then each graph should be seperate from any other graph. As you have been advised, creating a control or user control is the best (and only) solution. This control should get the information it needs to render itself independently of any other instance. In which case you would need to pass to it the graphics context, if necessry, and any data necessary to render.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
stephen.darling wrote: How can I setup my OnDraw() to display a different graph, based on what info is passed into my ecg object at runtime?
A simple solution.
you need to create Property
example:
public enum Graphs {Graph1, Graph2, Graph3);
private Graphs graphs;
public Graphs GraphType
{
get
{
return graphs;
}
set
{
if (graphs==value)
return;
graphs = value;
this.Invalidate();
}
}
after that use in a if or case statment inside OnPaint to select correct graph. But graphs are fairly complicated thing, so i suggest add sevreal methods for each graph and pass parameter Graphics.
And you can use for GDI a DoubleBuffer in orther to avoid some flickers. For better look you can applay antialiasing with a performance cost.
Also Mark makes good point
|
|
|
|
|
Hi.
I have a number of different sounds associated with defferent objects.
e.g.
ECGMachine objeect - beep1.wab, beep2.wav
Patient - breathNormal.wav, breathFast.wav, shout.wav
etc
Should I add the file path and relevent code of the sounds in each class, or create a soundPlay object?
If I do create a seperate object to play all sounds, what is the best way for all my objects to interact with it?
Thank you
Steve
|
|
|
|
|