Results 1 to 4 of 4

Thread: I need help writing code

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2022
    Posts
    3

    Post I need help writing code

    I want to manually view a file and not automatically view all files

    ListView1_MouseDoubleClick

    Code:
    private void ListView1_MouseDoubleClick(object sender, MouseEventArgs e)
            {
                try
                {
    
                    var di = new DirectoryInfo(Application.StartupPath + "/PKGS");
    
    
                    // ext/icon lookup
                    var exts = new List<string>();
                    ImageList1.Images.Clear();
    
                    foreach (FileInfo fi in di.EnumerateFiles("*.pkg"))
                    {
                        ListViewHitTestInfo info = ListView1.HitTest(e.X, e.Y);
                        ListViewItem item = info.Item;
    
                        if (item != null)
                        {
                            var pkgfile = PKG.SceneRelated.Read_PKG(fi.FullName);
                            pbPkgicon.Image = BytesToBitmap(pkgfile.Icon);
                            pbPkg.BackgroundImage = BytesToBitmap(pkgfile.Image);
                            MessageBox.Show(lblPackageInfo.Text = pkgfile.PS4_Title + "\n"  + 
                            pkgfile.PKG_Type.ToString() + "\n" + pkgfile.PKGState + "\n" +
                            pkgfile.Param.TitleID);
                        }
                        else
                        {
    
                        }
    
    
                    }
                }
                catch (Exception ex)
                {
                    Interaction.MsgBox(ex.Message, MsgBoxStyle.Critical);
                }
            }
    Error explanation video
    https://mega.nz/file/hewUhCwQ#Tgr6ou...QuCLuvOYt4im3A

    Download Link
    PKG View List-source
    https://bit.ly/3ILACeB

    Thanks 🌹

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    11,711

    Re: I need help writing code

    Moved to the C# thread
    "Code is like humor. When you have to explain it, it is bad." - Cory House
    VbLessons | Code Tags | Sword of Fury - Jameram

  3. #3
    PowerPoster yereverluvinuncleber's Avatar
    Join Date
    Feb 2014
    Location
    Norfolk UK (inbred)
    Posts
    2,235

    Re: I need help writing code

    We ALL need help writing code. The skill is learning how to obtain targetted help and you don't get that with a uselessly worded generalisation as the subject of your post.
    https://github.com/yereverluvinunclebert

    Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.

    By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,297

    Re: I need help writing code

    Quote Originally Posted by yereverluvinuncleber View Post
    We ALL need help writing code. The skill is learning how to obtain targetted help and you don't get that with a uselessly worded generalisation as the subject of your post.
    I have to agree. I came here to help but I don't really know what your problem is because you haven't explained it. I expect a FULL and CLEAR explanation of the problem to be provided in the post and I'm not the only one.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width