0
我需要OpenDialog窗口在Silverlight应用程序的浏览器窗口中。我想知道是否有可能。任何帮助,高度赞赏!是否有可能在Silverlight的子窗口中打开对话框窗口?
下面是我不得不打开子窗口和OpenDialog代码:
private void openChildWindow_Click(object sender, System.Windows.RoutedEventArgs e)
{
Add_ChildWindow ap = new Add_ChildWindow();
ap.Show();
OpenFileDialog openFileDialog1 = new OpenFileDialog();
// Set filter options and filter index.
openFileDialog1.Filter = "Packages (*.sprj)|*.sprj|Packages (*.sprj)|*.sprj";
openFileDialog1.FilterIndex = 1;
openFileDialog1.Multiselect = true;
// Call the ShowDialog method to show the dialog box.
bool? userClickedOK = openFileDialog1.ShowDialog();
// Process input if the user clicked OK.
if (userClickedOK == true)
{
// Open the selected file to read.
//textBox1.Text = openFileDialog1.File.Name;
System.IO.Stream fileStream = openFileDialog1.File.OpenRead();
using (System.IO.StreamReader reader = new System.IO.StreamReader(fileStream))
{
// Read the first line from the file and write it the textbox.
// tbResults.Text = reader.ReadLine();
}
fileStream.Close();
}
}
谢谢你的提示。我会继续寻找答案。 – vladc77 2011-03-06 19:47:47