首页
\
问答
\
用于在按钮单击Winforms期间按住SHIFT的事件句柄(An event handle for holding SHIFT during a button click on a Winforms)
用于在按钮单击Winforms期间按住SHIFT的事件句柄(An event handle for holding SHIFT during a button click on a Winforms)
我的Visual Basic.NET项目表单(VS 2013)中有以下事件句柄。
我想知道我是否可以修改它以便我可以区分正常点击和按下按钮期间有人按住
SHIFT
按钮。Private Sub btnLLDoubleDip_Click(sender As Object, e As EventArgs) Handles btnLLDoubleDip.Click ' Double Dip is easy... ' Stop the timer ' Create a flag that this is now a double dip attempt, NO MORE WALK OUTS End Sub
I have the following event handle in my Visual Basic.NET project form (VS 2013).
I wanted to know if I can modify it so that I can distinguish between a normal click and when someone is holding either
SHIFT
button during the button press.Private Sub btnLLDoubleDip_Click(sender As Object, e As EventArgs) Handles btnLLDoubleDip.Click ' Double Dip is easy... ' Stop the timer ' Create a flag that this is now a double dip attempt, NO MORE WALK OUTS End Sub
原文:https://stackoverflow.com/questions/31735052
更新时间:2024-05-07 11:05
最满意答案
它将所有东西粘贴在同一行,因为你没有计算每个新值的lastrow。
Sub Macro3() Dim lastrow As Long, ws As Worksheet Set ws = Sheets("named content") Dim c As Range For Each c In Range("MasterList").Offset(, -1).Cells If c = "P" Then lastrow = ws.Range("F" & Rows.Count).End(xlUp).Row + 1 ws.Range("F" & lastrow).Value = c.Offset(, 1) End If Next c End Sub
Its pasting everything in the same row, because you didnt calculate the lastrow with every new value.
Sub Macro3() Dim lastrow As Long, ws As Worksheet Set ws = Sheets("named content") Dim c As Range For Each c In Range("MasterList").Offset(, -1).Cells If c = "P" Then lastrow = ws.Range("F" & Rows.Count).End(xlUp).Row + 1 ws.Range("F" & lastrow).Value = c.Offset(, 1) End If Next c End Sub
相关问答
更多-
我会使用aggregate来获得这两个聚合,然后merge它们merge到一个数据框中: > df A B C 1 1.2 4 8 2 2.3 4 9 3 2.3 6 0 4 1.2 3 3 5 3.4 2 1 6 1.2 5 1 > num <- aggregate(B~A,df,length) > names(num)[2] <- 'num' > totalB <- aggregate(B~A,df,sum) > names(totalB)[2] <- 'totalB' > merge(n ...
-
根据另一列中的值查找两个其他列的值范围(Finding a range of values two other columns from based on values in another column)[2023-04-18]
你可以这样试试: tableBcol1=[int(i.split()[0]) for i in open('TableB.txt')] tableA=[i.strip() for i in open('TableA.txt')] count=0 for bcol1 in tableBcol1: for line in tableA: lbound,hbound=line.split() if bcol1 in range(int(lbound),int(hbound ... -
Pandas - 将值中的值汇总到另一列中的值之间(Pandas - Sum values in one column in between values in another)[2022-10-31]
如果需要数字列,请使用groupby和sum s和numpy.where来添加空字符串或NaN 。 a = df['A'].shift().cumsum().fillna(df['A'].iat[0]) df['C'] = np.where(a.duplicated(keep='last'), '', df['B'].groupby(a).transform('sum')) print (df) A B C 0 1 5 1 0 2 2 0 1 3 0 ... -
如何根据另一列在一列中累积SQL中的值?(how to accumulate values in SQL in one column based on another column?)[2021-11-14]
这将有效: Declare @Table as Table (Item1ID varchar(10),Item1Qty int,Item2ID varchar(10),Item2Qty int,Multiplier int) Insert into @Table Values ('10001',1,'10003',3,4), ('10004',3,'10002',5,2), ('10003',3,'10001',4,3) Declare @Table1 as Table (Item1ID varchar( ... -
有条件地计算另一列中的值的一列的递归(Compute recursion for one column conditionally on values in another columns)[2022-08-20]
这是部分答案。 首先,让我们将数组声明为arr[MAX][8] ,这意味着你有MAX行和8列。 这样可以更轻松地对数据进行排序。 接下来,让我们创建虚拟数据0.100, 0.101, ...更容易看到它。 要查找第5列,可以使用附加循环( for(int j = i; j < count; j++){...} )来查找下一个非零值。 每次arr[i][1]为零时,我们必须跟踪总死数( dead_count )和增量。 Kaplan-Meier公式被视为1 - (double)dead_count/(doub ... -
您可以将两个管道组合起来,并一次执行相同的功能。 即.. a <- data.frame(x=c('A','A','A','B','B','B'), y=c('Yes','No','No','Yes','No','No'), z=c(1,2,3,4,5,6)) a %>% left_join(a %>% filter(y=='Yes') %>% distinct(x,y,z), by='x') %>% sele ...
-
哦,这是怪异的。 我现在有一个几乎完全相同的任务 - 除了我是从SQL导入Excel的月度飞行日志,必须将每日时间转移到飞行员的个人工作表。 将“帐户”切换为“试用”并将“金额”切换为“航班时间”,我们的项目完全相同。 我几乎只是在下面剪切并粘贴了我的代码,它会为你完成整个shabang。 在StackOverflow上解决某人的整个任务并不是很好,但在这种情况下,只是粘贴一些程序似乎毫无意义。 对我来说,最重要的教训是将Excel仅用作数据检索和数据显示界面。 诀窍是创建自己的数据结构,将数据读入其中,根 ...
-
您也可以使用pmin找到每行的min with(df, pmin(value1, value2)) ## [1] 20 15 20 一些基准 set.seed(123) test1 <- sample(1e3, 1e8, replace = TRUE) test2 <- sample(1e3, 1e8, replace = TRUE) ### My solution system.time(res1 <- pmin(test1, test2)) # user system elapsed # 2. ...
-
它将所有东西粘贴在同一行,因为你没有计算每个新值的lastrow。 Sub Macro3() Dim lastrow As Long, ws As Worksheet Set ws = Sheets("named content") Dim c As Range For Each c In Range("MasterList").Offset(, -1).Cells If c = "P" Then lastrow = ws.Range("F" & Rows.Count).End(xl ...
-
between使用boolean indexing : df = df[df['scale'].between(-7,0)] print (df) scale year value 3 -7 2017 1 161 4 -6 2017 1 331 5 -5 2017 1 133 6 -4 2017 899 7 -3 2017 1 063 8 -2 2017 1 320 9 -1 2017 1 20 ...