狠狠色丁香婷婷综合尤物/久久精品综合一区二区三区/中国有色金属学报/国产日韩欧美在线观看 - 国产一区二区三区四区五区tv

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

[點(diǎn)晴永久免費(fèi)OA]C# 雙擊ListView出現(xiàn)編輯框可編輯,回車(chē)確認(rèn)

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

1. 
//
獲取鼠標(biāo)點(diǎn)擊的項(xiàng)------API

2.          [DllImport("user32")]

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

4.   

5.          private TextBox txtInput;

6.   

7.          //獲取點(diǎn)擊項(xiàng)的位置

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坐標(biāo)

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; //得到長(zhǎng)度和ListView的列的長(zhǎng)度相同                   

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.        //回車(chē)保存內(nèi)容

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.        //釋放文本框內(nèi)容

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 編輯過(guò)
關(guān)鍵字查詢(xún)
相關(guān)文章
點(diǎn)晴ERP是一款針對(duì)中小制造業(yè)的專(zhuān)業(yè)生產(chǎn)管理軟件系統(tǒng),系統(tǒng)成熟度和易用性得到了國(guó)內(nèi)大量中小企業(yè)的青睞。
點(diǎn)晴PMS碼頭管理系統(tǒng)主要針對(duì)港口碼頭集裝箱與散貨日常運(yùn)作、調(diào)度、堆場(chǎng)、車(chē)隊(duì)、財(cái)務(wù)費(fèi)用、相關(guān)報(bào)表等業(yè)務(wù)管理,結(jié)合碼頭的業(yè)務(wù)特點(diǎn),圍繞調(diào)度、堆場(chǎng)作業(yè)而開(kāi)發(fā)的。集技術(shù)的先進(jìn)性、管理的有效性于一體,是物流碼頭及其他港口類(lèi)企業(yè)的高效ERP管理信息系統(tǒng)。
點(diǎn)晴WMS倉(cāng)儲(chǔ)管理系統(tǒng)提供了貨物產(chǎn)品管理,銷(xiāo)售管理,采購(gòu)管理,倉(cāng)儲(chǔ)管理,倉(cāng)庫(kù)管理,保質(zhì)期管理,貨位管理,庫(kù)位管理,生產(chǎn)管理,WMS管理系統(tǒng),標(biāo)簽打印,條形碼,二維碼管理,批號(hào)管理軟件。
點(diǎn)晴免費(fèi)OA是一款軟件和通用服務(wù)都免費(fèi),不限功能、不限時(shí)間、不限用戶(hù)的免費(fèi)OA協(xié)同辦公管理系統(tǒng)。
Copyright 2010-2025 ClickSun All Rights Reserved