Exemplo n.º 1
0
        /// <summary>
        /// Load the selected friend into the form.
        /// </summary>
        private void LoadFriend(int index)
        {
            //make sure the friend isnt the current friend.
            if (index != currentFriend)
            {
                //Set the current friend.
                currentFriend = index;

                //Set the row to selected.
                data.Rows[index].Selected = true;

                //Set the scroll index.
                data.FirstDisplayedScrollingRowIndex = data.SelectedRows[0].Index;

                //Get the selected friend.
                Friend friend = friends[index];

                //Set the name text.
                Name_Text.Text = friend.name;

                //Set the likes text.
                Likes_Text.Text = friend.likes;

                //Set the dislikes text.
                Dislikes_Text.Text = friend.dislikes;

                //Set the D.O.B text.
                DateTime dob = DateTime.Parse(friend.dob);
                DOB.SetDate(dob);

                //Set button to false.
                button = false;
            }
        }