|
Wow, I don't know what makes you so dumb but it really works. We don't do homework for you.
|
|
|
|
|
Pete O'Hanlon wrote: I don't know what makes you so dumb but it really works.
That is funny
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Simple. Go do your own homework. Ask people for help when you have a specific problem.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
Hi all
have a good day
how I can write a good code for my apps
I mean , I know a lot of stuff ( API , WMI , Database , Drawing , Encryption , Sockets .... )
and every time I write a program it's work very fine ,
but I didn't like the code that I write
(I need my code to be like professionals code)
for example .... I used this in one of my apps
[code]
lbl1.Text = Environment.GetFolderPath(Evironment.SpecialFolder.Personal);
lbl2.Text = Environment.GetFolderPath(Evironment.SpecialFolder.Desktop);
.
.
.
.
all the special folders
[/code]
but someone professional wrote it this way :
He created a new class file ( Folders.cs ) and add it to project
[code]
public class SpecialFolder
{
private static string [] SpecialFolders = null;
static SpecialFolder()
{
SpecialFolders[0] = Environment.GetFolderPath( Environment.SpecialFolder.Personal);
SpecialFolders[1] = Environment.GetFolderPath( Environment.SpecialFolder.Desktop);
.
.
.
.
}
public static string Documents { get { return SpecialFolders[0]; } }
public static string Desktop { get { return SpecialFolders[1]; } }
}
[/code]
------ and he used it like
[code]
lbl1.Text = SpecialFolder.Desktop;
lbl2.Text = SpecialFolder.Documents ;
.
.
.
.
[/code]
would be please advice me what should I read , or what should I learn ..
Kind regards ...
I know nothing , I know nothing
|
|
|
|
|
Read articles on this site. Look for articles that get higher ratings and have a read through the code. BTW - the code that you quoted as being written by a professional developer isn't very good. This should have been done in a much more robust fashion, e.g.
public enum SpecialFolderType
{
Desktop,
Personal
} Then further on...
private Dictionary<SpecialFolderType, string> _folders = new Dictionary<SpecialFolderType, string>();
...
_folders.Add(SpecialFolderType.Desktop, Environment.SpecialFolder.Personal); .. and so on.
Then you would retrieve it with
public string Desktop { return _folders[SpecialFolderType.Desktop].Value; } Obviously there are more things that could be done to beef this up even further, such as checking values and so on, but you get the idea.
|
|
|
|
|
Thank you so much , for your fast , useful replay
- you said : (BTW - the code that you quoted as being written by a professional developer isn't very good.)
Mr.Pete After I saw your code , I believe that you are right .
His code is not very good , but he is better than me , and you are better than two of us ....
thank you ...
Kind regards ...
I know nothing , I know nothing
|
|
|
|
|
Code Complete is a very good book for general style issues.
<blockquote class="FQ"><div class="FQA">Stark DaFixzer wrote:</div>lbl1.Text = Environment.GetFolderPath(Evironment.SpecialFolder.Personal);
lbl2.Text = Environment.GetFolderPath(Evironment.SpecialFolder.Desktop);</blockquote>
All that sucks about this is the variable names.
Stark DaFixzer wrote: public class SpecialFolder
{
private static string [] SpecialFolders = null;
static SpecialFolder()
{
SpecialFolders[0] = Environment.GetFolderPath( Environment.SpecialFolder.Personal);
SpecialFolders[1] = Environment.GetFolderPath( Environment.SpecialFolder.Desktop);
This is a waste of time in my book. All it does is rewrap something that is already exposed by the framework, and it obsfucates it. Unless there's ever a chance you want to change where SpecialFolder.Desktop points, it's just a waste of time to do this.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thank you Mr.Christian Graus
I will download this book ,
by the way ( may be the Specialfolders Class waste of time ) but the good practice would help you in the future to solve the big prb's
kind regards ...
I know nothing , I know nothing
|
|
|
|
|
Stark DaFixzer wrote:
I will download this book
I hope you mean you will buy it.
Stark DaFixzer wrote: by the way ( may be the Specialfolders Class waste of time ) but the good practice would help you in the future to solve the big prb's
Yes, centralizing things so you can change them app wide in one place is a good practice. Good practices adhered to blindly become bad practices.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
hi
1. how can i color line in one color and other line in another color ?
2. how can i pic more than 1 line, and use them ?
thanks for any help
|
|
|
|
|
Hi
I am using C# .NET 1.1
---------------
1 - Use this option at your gridview properties
"AlternatingBackColor" , ( this for your Question )
"BackgroundColor" ,
"GridLineColor" ,
2 - I will back to answer as soon as possible , sorry
kind regards ...
I know nothing , I know nothing
|
|
|
|
|
1. Datagridview has got a property called DefaultCellStyle which is used to control how cells are rendered in that row.
2. Use MultiSelect property of Datagridview class. You can find selected rows by using SelectedRows property. Intuitive, isn't it?
|
|
|
|
|
i try, but i dont see any change in colors
i work in VS2008 and programing in c#
|
|
|
|
|
Can you post snippet of your code? Also, do the rows contain data?
|
|
|
|
|
Hi,
I want to pop up a reminder kinda pop up from the right bottom task bar when a button is clicked on the UI. Like an outlook "you have a new message" kinda popup.
How should i do it under button click event. ?
Thanks
|
|
|
|
|
Create a notify icon for your app, then look at the NotifyIcon.BalloonTip method.
Kristian Sixhoej
"Failure is not an option" - Gene Kranz
|
|
|
|
|
Hi All,
I am using C# 2.0 and I need to add following functionality to my application: User should be able to attach/detach component and move them around just like in visual studio. Please help if you can.
Thanks in Advance.
A.Asif
|
|
|
|
|
|
I am trying to customize my repeater control for my web application.
I am trying to add the column headings for my control using
<thead bgcolor="#66ccc">
<th></th>
I am getting the following error for the <th> tags..
Per the active schema, the element 'th' cannot be nested within 'thead'
I dont know what i am doing wrong?? please help?
(I have created a schema for my XML file)
BTW <tr></tr> tags are working fine.</th></thead>
Cheers
|
|
|
|
|
The error should be fine to ignore, I get those all the time.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I finally got my project done, sorry i should have said we got my project done... thank you so much, i know i couldn´t have done it without your support and help. We got A+ and my professor loved it and thought it was the best project presented to him during last december 1st.
I can´t express with words my gratitude to each and one of you but please accept this: Thanks!!!
Thanks for helping me become an engineer and finish college!!!
Sincerly best regards,
Luis E Tineo S
|
|
|
|
|
Glad we could help. Hopefully you'll stick around CP and contribute to this fine community.
|
|
|
|
|
Of course my friend. I started to work on building an small library and so far so good.
I would like to learn C# and add some knowlegde of Visual Basic and ASP to help as much as people as i can.
There's not way i won't be trying to help somehow!!!
Thanks Again!
Luis E Tineo S
|
|
|
|
|
glad to know, keep going my friend :^: :^:
Becoming Programmer...
|
|
|
|
|
I'm new to the thread concept so I apologize for what could be a simple question.
I have a process where I am creating a variable number of graphics objects (balls), each running in their own thread (not a ThreadPool).
As each object moves and bounces around the screen, I would like to check if the existing ball intersects any of the other balls. If they do, I need to remove the colliding balls, I assume using Abort.
I have been trying to see if I can loop through the currently active threads and compare using Rectangle.Intersects but I have not seen any references on a thread collection.
Any ideas or suggestions would be appreciated.
|
|
|
|