Author Topic: [Resolved] Control Array  (Read 1132 times)

0 Members and 1 Guest are viewing this topic.

cadpro

  • Guest
[Resolved] Control Array
« on: January 08, 2009, 03:22:56 AM »
Could anybody help me on how to add slides as control array to a form in C#? If that is not possible, I would add it manually, but how do I assign file names to each slide?

Here is the code.

Code: [Select]
private void TV_AfterSelect(object sender, TreeViewEventArgs e)
{
TreeNode newSelected = e.Node;
DirectoryInfo nodeDirInfo = (DirectoryInfo)newSelected.Tag;

sldNum = nodeDirInfo.GetFiles("*.sld").Count();

foreach (FileInfo file in nodeDirInfo.GetFiles())
{
if (file.Extension==".sld")
{
axSlide1.FileName = file.FullName;
.
.
.
.

}
}
}
« Last Edit: January 11, 2009, 12:51:51 AM by cadpro »

cadpro

  • Guest
Re: Control Array
« Reply #1 on: January 08, 2009, 03:50:57 AM »
An update! Here's the code.

Code: [Select]
private void TV_AfterSelect(object sender, TreeViewEventArgs e)
        {
            TreeNode newSelected = e.Node;
            DirectoryInfo nodeDirInfo = (DirectoryInfo)newSelected.Tag;

            int numFile = 0;

            sldNum = nodeDirInfo.GetFiles("*.sld").Count();
            //sldNum = sldNum / 15;

            foreach (FileInfo file in nodeDirInfo.GetFiles())
            {
                if (file.Extension==".sld")
                {                   
                    //axSlide1.FileName = file.FullName;
                    numFile++;
                    slide[numFile] = new AxSLIDELib.AxSlide();
                    slide[numFile].Width = 125;
                    slide[numFile].Height = 115;
                    slide[numFile].Left = 9 + slide[numFile].Width;
                    slide[numFile].Top = 23 + slide[numFile].Height;

                    slide[numFile].FileName = file.FullName;
                }
            }
        }