如题;
我是想实现先查询,在listBox中显示,然后双击一项,就打开一个窗体或对话框,
显示我所选定的文件,还请诸位高手帮忙    
ps:我的文件是文本的.txt

解决方案 »

  1.   

    private void listBox1_DoubleClick(object sender, System.EventArgs e)
            {
                switch(this.listBox1.SelectedIndex)
                {
                    case 0:
                        MessageBox.Show("1");
                        break;
                    case 1:
                        MessageBox.Show("2");
                        break;
                    case 2:
                        MessageBox.Show("3");
                        break;
                    default:
                        MessageBox.Show("4");
                        break;
                }
            }
      

  2.   

    <html>
      <head>
        <title>BrioAll</title>
        <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
        <meta name="CODE_LANGUAGE" Content="C#">
        <meta name=vs_defaultClientScript content="JavaScript">
        <meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
      <script>
      
      function openw()
      {
    window.open("","","")
      }
      </script>
      </head>
      <body MS_POSITIONING="GridLayout">

        <form id="Form1" method="post" runat="server">
        <table border=0></table>
    <asp:ListBox ID=aa Runat=server ondblclick=openw()> <asp:ListItem Value =a>a</asp:ListItem>
    <asp:ListItem Value=b>b </asp:ListItem>
    </asp:ListBox>
         </form>

      </body>
    </html>
      

  3.   

    trendChart是一个窗体的实例,初始值为null 
    if (trendChart == null || trendChart.IsDisposed == true)
                {
                    trendChart = new TrendChart();
                    trendChart.MdiParent = this;
                    trendChart.Parent = this.panelEx2;
                    trendChart.Show();
                }
                else
                {
                    trendChart.Show();
                    trendChart.WindowState = FormWindowState.Maximized;
                }