PDA

View Full Version : سوال: مشکل در نمایش اطلاعات در tab



shytonak
پنج شنبه 05 اسفند 1389, 16:23 عصر
دوستان من با استفاده از کد وقتی روی یکی از آیتم های لیست باکس کلید میشه یه تب جدید به تب پیچ اضافه میشه و می خوام وقتی این تب جدید اضافه میشه یه فایل pdf درون این تب مایش داده بشه.اما کدی که نوشتم مشکل داره و ارور میده.ممنون میشم یه نگاه بهش بندازین.

string text = listBox1.SelectedItem.ToString();
tab[i] = new TabPage();
rtb[i] = new O2S.Components.PDFView4NET.PDFPageView();
rtb[i].Location = new System.Drawing.Point(0, 0);
rtb[i].Size = new System.Drawing.Size(838, 542);
rtb[i].BackColor = Color.White;
pdfd[i] = new O2S.Components.PDFView4NET.PDFDocument();
tab[i].Controls.Add(rtb[i]);
tab[i].Location = new System.Drawing.Point(4, 22);
tab[i].Name = "tab" + i.ToString();
tab[i].Padding = new System.Windows.Forms.Padding(3);
tab[i].Size = new System.Drawing.Size(400, 242);
tab[i].Text = text;
tab[i].UseVisualStyleBackColor = true;
tabControl1.TabPages.Add(tab[i]);
i++;
string inFile = Environment.CurrentDirectory + "\\Data\\" + listBox1.SelectedItem.ToString() + ".pdf.fcfe";
int index = inFile.LastIndexOf(".fcfe");
CryptoProgressCallBack cb = new CryptoProgressCallBack(this.ProgressCallBackDecryp t);
CryptoHelp.DecryptFile(inFile, (Environment.GetFolderPath(Environment.SpecialFold er.History)) + listBox1.SelectedItem.ToString() + ".fcfd", "1366", cb);
pdfd[i].FilePath = (Environment.GetFolderPath(Environment.SpecialFold er.History)) + listBox1.SelectedItem.ToString() + ".fcfd";
rtb[i].Document = pdfd[i];
rtb[i].Show();
rtb[i].PageNumber = 0;