我在winfrom上有一个POS客户端应用程序。我的客户有触摸屏系统,因此我需要实现按钮才能在gridview中滚动。
现在我面临的问题是我无法隐藏滚动条。当我尝试隐藏滚动条时,出现黑色的分割图像
System.setProperty("webdriver.chrome.driver",
"C:\\Users\\chromedriver\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
答案 0 :(得分:0)
vb.net,经过测试,panel2位于panel1内,panel2的宽度比panel1大一点,足以隐藏滚动条:
Public Class Form1
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Panel1.HorizontalScroll.Visible = False
Panel1.VerticalScroll.Visible = False
Panel2.AutoScroll = True
Panel2.HorizontalScroll.Visible = False
Panel2.VerticalScroll.Visible = True
End Sub
Private Sub Panel2_MouseWheel(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Panel2.MouseWheel
If Panel2.Bounds.Contains(e.Location) Then
Dim vScrollPosition As Integer = Panel2.VerticalScroll.Value
vScrollPosition = e.Location.Y
Panel2.Invalidate()
End If
End Sub
Private Sub Panel2_MouseEnter(sender As Object, e As EventArgs) Handles Panel2.MouseEnter
Panel2.Select()
End Sub
End Class
这可用于2个面板,它肯定会与另一个面板中的任何面板(例如datagridview)一起使用,您要做的就是使宽度足够大以隐藏条形图
这是一种简单的方法,因为如果您想真正隐藏它们,则将需要覆盖原始控件
答案 1 :(得分:0)
谢谢大家的支持。我已经自己修好了。如果有人需要帮助,我会共享代码
Private Sub VScrollBar1_VisibleChanged(ByVal sender As Object, ByVal e As EventArgs)
Try
If TypeOf (sender) Is VScrollBar Then
Dim scrollBar As VScrollBar = CType(sender, VScrollBar)
If TypeOf (scrollBar.Parent) Is KryptonExtendedGrid Then
Dim KryptonGrid As KryptonExtendedGrid = CType(scrollBar.Parent, KryptonExtendedGrid)
If KryptonGrid.ScrollControl IsNot Nothing Then
If KryptonGrid.ScrollBars = ScrollBars.Vertical Then
KryptonGrid.ScrollBars = ScrollBars.None
KryptonGrid.ScrollControl.DownButton.Enabled = True
Else
KryptonGrid.ScrollControl.DownButton.Enabled = False
End If
End If
End If
End If
Catch ex As Exception
End Try
End Sub