내 목표를 작동하지 않는 것은 다음과 같다 : The user enters the stuff as shown in this picture. The 3 items (source file, destination directory and if file exists) are saved in a string array. User clicks OK.동적으로 ListView를 열 문자열을 표시 -
나는 테이블의 입력 파일 & 디렉토리 보여주기 위해 다음 코드를 사용하고 있습니다 :
private void okButton_Clicked(object sender, EventArgs e)
{
//saving user's input
userInput = new string[3];
userInput[0] = sourceFileTextBox.Text;
userInput[1] = destinationDirComboBox.SelectedItem.ToString();
userInput[2] = ifFileExistsComboBox.SelectedItem.ToString();
//creating a new ListView object - the object is derived from the ListView Class
and has absolutely nothing in the constructor or anywhere
Classes.ListViewDerivative lvd = new Classes.ListViewDerivative();
ListViewItem item1 = new ListViewItem(userInput[0]);
item1.SubItems.Add(userInput[1]);
lvd.Items.AddRange(new ListViewItem[] { item1 });
this.DialogResult = DialogResult.OK;
this.Hide();
}
을
작동하지 않습니다. 이 코드를 어디에 넣든 테이블이 비어 있습니다. ListViewDerivative 생성자, ListViewDerivative 클래스의 함수 및 editFileEntry (첫 번째 그림) 클래스에이 적응 코드를 넣으려고했습니다. 오른쪽 텍스트는 배열에 저장되지만 표에는 표시되지 않습니다. 도와주세요!
당신이 당신의 ListView에 필요한 열을 추가 했습니까? – TaW