|
This idea is not good from a from an oo point of view. It is important to encapsulate your classes properly.
You have a need for a team class, it should be responsible for maintaining it's own list of players. Likewise each player must maintain it's own information (e.g. Name, Position etc).
I suggest you try my example. To get the list of players in a particular position, you would just have to loop around each team, then loop each roster looking for players of the type required.
I also suggest you find a good OO book and learn the basic principles. If you are using an OO language like C#, learning OO principles will make coding easier for you, and the code you will produce will be neater and easier to maintain and understand. It is difficult to make the mental shift from procedure to object oriented programming, but doing so will make your life easier when using c# and is well worth the effort.
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
|
|
|
|
|
I have a winform with two texboxes, one below the other.
When i resize horizontal there is no problem, but when i want to resize vertical only can resize one and i need to resize both proportionally.
Already tryed many anchor property configurations without luck...
Any idea?
Thanks in advance.
|
|
|
|
|
Hi,
I was thinking about Anchor property as well. How about using a SplitContainer in a horizontal oritation, with two textBoxes Dock property set as Fill?
Br!"
Sun
|
|
|
|
|
You suggestion not soove my needs... each texbox is on different groupbox...
|
|
|
|
|
I solved it with main form Resize event... and playing with groupbox Top and Height properties.
Thanks anyways....
|
|
|
|
|
Hi,I am doing a project related to image erosion .. can someone help me to write codings for th erosion process alone in c# (windows application).
|
|
|
|
|
hi,this is suhdir final year in computer science and engineering.i am doing a project for my final year.project is a chatting software.project details:
software is similar to gtalk and diffrence is here conference call is possible.i have done the chatting part but one thing i am in delema how to make call??plz give me some idea how to make call.time is short in my hand.plz help me.
|
|
|
|
|
Are you talking about this :
http://dotnet.org.za/ruari/archive/2004/11/10/6254.aspx
In fact, I havent tried it. I did a chat application but not actually making conference calls.
Might be some1 else can help.
|
|
|
|
|
Hi,
Does anyone have idea on how to create a few radio buttons using data from XML file?
I would like to have the buttons to be created once I load the form. But I do not have any idea as I started learn about XML today.
Thank you in advance.
Zar Ni
|
|
|
|
|
Well.. just parse the XML document (plenty of tutorials online) and find the elements representing the radio buttons. And in your Form_Load event you create the buttons and add them to the Form. Good luck!
|
|
|
|
|
Can't work out what I'm doing wrong. When I programmatically add a button to the first cell of a table layout panel by calling 'tlp.Controls.Add(newButton, 0, 0) ' it works the first three times, shifting existing controls along a cell as expected. However after the third time the same code inserts the button into the second cell a few times, then after more calls, the third etc. Examlpe code below.
Is there a limit on how many times you can call Controls.Add(ctrl, column, row) for a given cell?
private int nextIndex = 1;
private void bAddButton_Click(object sender, EventArgs e)
{
Button newButton = new Button();
newButton.Text = nextIndex.ToString();
tableLayoutPanel1.Controls.Add(newButton, 0, 0);
nextIndex++;
}
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:05am.
|
|
|
|
|
Thank you for your quick reply. However I only want one button per cell for scaling reasons.
|
|
|
|
|
Hello
I am working on examination project. I hava a column Position in Database. I am storing position in this column on the basis of obtained marks.suppose that i have entered 50 students record and assign each student a position on the basis of obtained marks. now i enter 51 number student and the obtained marks of this new student are higher than all students,definitely i will assign 1(ist position) to this student and all other students Positions will be changed. A student who is on ist position before entering 51 student record will changed from ist to 2nd position and rest of students positions also changed.
Now when i use update command from C# it only updates one row and left other rows to old values. i am using update in a loop.
And only a single row which is updated is of those student who has less marks than new 51 number student and rest of the rows are not updated.
Plz reply immediate
Thanks
Regards Usman Ahmad
|
|
|
|
|
Member 2367800 wrote: Plz reply immediate
Nobody is going to reply if you post a question with this.
How about posting the update code and we can see where the problem is. For starters I would re-evaluate the whole order. Just updating/adding the one student would not "auto" update the rest of them. Post the code you use for the update and we can check or advise from there.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Thanks to every one who replied me. I have solve the problem.
regards
Usman Ahmad
|
|
|
|
|
Is there any way to convert HTML content to plain text.
I want simple/plain text present in HTML content.
|
|
|
|
|
Message Closed
modified 23-Nov-14 7:06am.
|
|
|
|
|
i read that article and its really helpful.
My another question related to same issue.
instead of converting, is it possible to make richtextbox able to understand HTML.
like when we open open a file in IE(web browser).
Does same can be achieve for richtextbox control?
Its a window application.
|
|
|
|
|
Hi Experts.,
I m using datetimepicker.when i retrive the value of date from grid it comes correctly in my string var i.e dd/mm/yyyy.But when i assign it to dtp.Text it gets displayed in mm/dd/yyyy
Sharing Of Knowledge Provides Solution....
|
|
|
|
|
I am using:
<br />
foreach (DebtorDataSet.PaymentArrangementsRow row in debtorDataSet.PaymentArrangements.Rows)<br />
{<br />
if (row.PaymentArrangementID != -1 && row.PaymentTypeID == Convert.ToInt32(paymentCategoryComboBox.SelectedItem) && row.ArrangementComplete == false)<br />
{<br />
row.ArrangementComplete = true;<br />
row.ArrangementDate = DateTime.Today;<br />
}<br />
}
but this is giving me the error:
'Unable to cast object of type 'System.Data.DataRowView' to type 'System.IConvertible''
I am not sure how to correct this.
Any help would be much appreciated please.
|
|
|
|
|
I'm not really sure about it, but because there is only one line where you convert something I would
replace
Convert.ToInt32(paymentCategoryComboBox.SelectedItem)
with
Convert.ToInt32(paymentCategoryComboBox.SelectedItem.ToString())
But in general SelectedItem is not from the type 'System.Data.DataRowView' so I'm a little
bit confused with it. But maybe that helps.
Greetings
Covean
|
|
|
|
|
Many thanks for your reply.
Sill me realised that I needed SelectedValue instead of selectedItem to do the job.
The perils of late night coding .......
|
|
|
|
|
Hehe.
On the other hand its sometimes very funny to look over code you wrote in a stressful time.
Sometime its a bloomer just for the Coding Horrors section.
Greetings
Covean
|
|
|
|
|
What type is the SelectedValue?
If it's an int, why convert an int to an int? Just cast it.
If not, then you can probably cast it anyway.
I find the Convert class to be nearly entirely useless; try not to use it.
|
|
|
|