日韩欧美人妻无码精品白浆,夜夜嗨AV免费入口,国产欧美官网在线看,高校回应聋哑女生因长相完美被质疑

LOGO OA教程 ERP教程 模切知識交流 PMS教程 CRM教程 開發(fā)文檔 其他文檔  
 
網(wǎng)站管理員

[點晴永久免費OA]C# 雙擊ListView出現(xiàn)編輯框可編輯,回車確認

admin
2022年12月22日 20:39 本文熱度 1334

1. 
//
獲取鼠標點擊的項------API

2.          [DllImport("user32")]

3.          public static extern int GetScrollPos(int hwnd, int nBar);

4.   

5.          private TextBox txtInput;

6.   

7.          //獲取點擊項的位置

8.          private void lViewPersonWork_MouseDoubleClick(object sender, MouseEventArgs e)

9.          {

10.            try

11.            {

12.                ListViewItem item = this.lViewPersonWork.GetItemAt(e.X, e.Y);

13.

14.                //找到文本框

15.                Rectangle rect = item.GetBounds(ItemBoundsPortion.Entire);

16.                int StartX = rect.Left; //獲取文本框位置的X坐標

17.                int ColumnIndex = 0;    //文本框的索引

18.

19.                //獲取列的索引

20.                //得到滑塊的位置

21.                int pos = GetScrollPos(this.lViewPersonWork.Handle.ToInt32(), 0);

22.                foreach (ColumnHeader Column in lViewPersonWork.Columns)

23.                {

24.                    if (e.X + pos >= StartX + Column.Width)

25.                    {

26.                        StartX += Column.Width;

27.                        ColumnIndex += 1;

28.                    }

29.                }

30.

31.                if (ColumnIndex < this.lViewPersonWork.Columns.Count - 1)

32.                {

33.                    return;

34.                }

35.

36.                this.txtInput = new TextBox();

37.

38.                //locate the txtinput and hide it. txtInputTextBox

39.                this.txtInput.Parent = this.lViewPersonWork;

40.

41.                //begin edit

42.                if (item != null)

43.                {

44.                    rect.X = StartX;

45.                    rect.Width = this.lViewPersonWork.Columns[ColumnIndex].Width; //得到長度和ListView的列的長度相同                   

46.                    this.txtInput.Bounds = rect;

47.                    this.txtInput.Multiline = true;

48.                    //顯示文本框

49.                    this.txtInput.Text = item.SubItems[ColumnIndex].Text;

50.                    this.txtInput.Tag = item.SubItems[ColumnIndex];

51.                    this.txtInput.KeyPress += new KeyPressEventHandler(txtInput_KeyPress);

52.                    this.txtInput.Focus();

53.                }

54.            }

55.            catch (Exception ex)

56.            {

57.              

58.            }

59.        }

60.

61.        //回車保存內容

62.        private void txtInput_KeyPress(object sender, KeyPressEventArgs e)

63.        {

64.            try

65.            {

66.                if ((int)e.KeyChar == 13)

67.                {

68.                    if (this.txtInput != null)

69.                    {

70.                        ListViewItem.ListViewSubItem lvst = (ListViewItem.ListViewSubItem)this.txtInput.Tag;

71.

72.                        lvst.Text = this.txtInput.Text;

73.

74.                        this.txtInput.Dispose();

75.                    }

76.                }

77.            }

78.            catch (Exception ex)

79.            {

80.               

81.            }

82.        }

83.

84.        //釋放文本框內容

85.        private void lViewPersonWork_selectedIndexChanged(object sender, EventArgs e)

86.        {

87.            try

88.            {

89.                if (this.txtInput != null)

90.                {

91.                    if (this.txtInput.Text.Length > 0)

92.                    {

93.                        ListViewItem.ListViewSubItem lvst = (ListViewItem.ListViewSubItem)this.txtInput.Tag;

94.

95.                        lvst.Text = this.txtInput.Text;

96.                    }

97.

98.                    this.txtInput.Dispose();

99.                }

100.               }

101.               catch (Exception ex)

102.               {

103.                   

104.               }

105.           }


該文章在 2022/12/22 20:41:39 編輯過
關鍵字查詢
相關文章
正在查詢...
點晴ERP是一款針對中小制造業(yè)的專業(yè)生產(chǎn)管理軟件系統(tǒng),系統(tǒng)成熟度和易用性得到了國內大量中小企業(yè)的青睞。
點晴PMS碼頭管理系統(tǒng)主要針對港口碼頭集裝箱與散貨日常運作、調度、堆場、車隊、財務費用、相關報表等業(yè)務管理,結合碼頭的業(yè)務特點,圍繞調度、堆場作業(yè)而開發(fā)的。集技術的先進性、管理的有效性于一體,是物流碼頭及其他港口類企業(yè)的高效ERP管理信息系統(tǒng)。
點晴WMS倉儲管理系統(tǒng)提供了貨物產(chǎn)品管理,銷售管理,采購管理,倉儲管理,倉庫管理,保質期管理,貨位管理,庫位管理,生產(chǎn)管理,WMS管理系統(tǒng),標簽打印,條形碼,二維碼管理,批號管理軟件。
點晴免費OA是一款軟件和通用服務都免費,不限功能、不限時間、不限用戶的免費OA協(xié)同辦公管理系統(tǒng)。
Copyright 2010-2025 ClickSun All Rights Reserved