Windows后退按钮上的事件处理 [英] event handling on windows back button

查看:60
本文介绍了Windows后退按钮上的事件处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!!!
谁能帮我,我不熟悉c夏普...
如何在Windows后退按钮和向上按钮上进行事件处理...在C#中是否有用于此目的的任何方法..... !!!
谢谢.

关于Ame ..

hi !!!
can anyone help me i am new to c sharp...
how to do event handling on windows back button and up button...is there any method available in c# for this purpose.....!!!
thanks.

Regards Ame..

推荐答案

您如何期望我们为您提供帮助?

我看不到那里的这些按钮",我不知道您的代码是如何工作的,也不知道您用来存储或显示目录的内容.

考虑一下您需要什么信息,然后假装您正在尝试通过电话寻求帮助来修理汽车.另一个人看不见您的汽车,因此您要么必须详细解释自己拥有什么,想在哪里做以及是什么原因阻止您这样做.

此刻,您已经致电维修人员,并说:我的车有点破损"-我们需要更好的信息,就像他一样.
How do you expect us to help you with this?

I can''t see "these buttons over there", I have no idea about how your code works, I don''t know what you are using to store or show the directory.

Have a think about what information you need, and then pretend you are trying to get help to fix your car over the telephone. The other person can''t see your car, so you either have to explain in some detail what you have, where you want to do, and what is stopping you from doing it.

At the moment, you have called the repair man, and said: "My car is a bit broken" - we need better information, just as he would.


using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO;



namespace WindowsFormsApplication1
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

       

        private void Form1_Load(object sender, EventArgs e)
        {
            System.IO.DirectoryInfo dir = new System.IO.DirectoryInfo(@"\\MyDocuments\pictures");
            foreach (System.IO.FileInfo f in dir.GetFiles("*.*"))
            {
                //LOAD FILES
                ListViewItem lSingleItem = listView1.Items.Add(f.Name);
                //SUB ITEMS
                lSingleItem.SubItems.Add(Convert.ToString(f.Length));
                lSingleItem.SubItems.Add(f.Extension);
            }
            foreach (System.IO.DirectoryInfo d in dir.GetDirectories())
            {
                ListViewItem s = listView1.Items.Add(d.FullName + "\n");

                s.SubItems.Add(d.Extension);

            }

        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {

        }

        

        
        
        
    }
}



这是我的设计,我想对其按钮进行事件处理.



this is my design i want to do event handling over its buttons.


对于后退",您需要存储一堆以前的位置.每次导航到新文件夹时,都将新位置推入堆栈.当您按Back时,弹出最上面的一个(除非您也想要"Forward",在这种情况下还需要设置"virtual top"位置变量),然后移至现在位于堆栈顶部的文件夹.

对于向上",请使用 Path.GetDirectoryName [ ^ ].
For ''back'', you need to store a stack of previous locations. Each time you navigate to a new folder, push the new location onto the stack. When you press Back, pop the top one (unless you want ''Forward'' as well in which case set a ''virtual top'' location variable) and move to the folder now at the top of the stack.

For ''up'', use Path.GetDirectoryName[^].


这篇关于Windows后退按钮上的事件处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆