Voici mon extrait:OpenFileDialog Control - Comment puis-je saisir le chemin sélectionné et l'afficher dans une zone de texte?
private void btnBrowseCInv_Click(object sender, EventArgs e)
{
ofdBrowseVInv.Title = "Locate Customer Invoice File";
ofdBrowseVInv.Filter = "Portable Document Format (*.pdf)|*.pdf|All Files (*.*)|*.*";
ofdBrowseVInv.FileName = "";
ofdBrowseVInv.FilterIndex = 0;
ofdBrowseVInv.InitialDirectory = "";
ofdBrowseVInv.CheckFileExists = true;
ofdBrowseVInv.CheckPathExists = true;
if (ofdBrowseVInv.ShowDialog() == System.Windows.Forms.DialogResult.OK)
{
//txtInvoicePathCInv.Text = ofdBrowseVInv... What property should i use?
}
}
Comme vous le voyez ci-dessous, une fois qu'un utilisateur de choisir un fichier et cliquez sur Ouvrir. Je veux que le chemin sélectionné s'affiche dans la zone de texte pointée nommée "txtInvoicePathCInv". Une idée?
J'utilise des applications Windows ...
alt text http://img708.imageshack.us/img708/54/99763211.jpg
+1 points de style pour ajouter une capture d'écran! :) –