
正文
关于vb.netcs的信息
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
如何在VB.NET中引用CSGL库?
在VB.NET中不能直接添加opengl,需要引用csgl库.具体方法如下:
1 下载csgl库,压缩包内有libinstall和dep两个文件夹
2 运行libinstall文件夹下的install程序,将csgl.dll和csgl.native.dll文件添加至系统文件夹。
3 运用dep文件夹下的ResBuider程序(具体功能暂不可知)。
4 将dep文件夹下的Debug和Release文件夹内容分别复制到运行目录的相应文件夹中即可。
相关问答
Q1: VB.NET我要用鼠标轨迹画一个矩形框 然后选中控件。就像星际和魔兽争霸里对部队单位的选中一样~等大神回答
这个类继承自Panelvb.netcs,把它加到vb.netcs你vb.netcs的项目里面vb.netcs,先运行一下,然后从工具箱里把它拖到窗体上,然后再向里面添加其它控件就可以了,支持Shift加选,Alt减选
Imports System.Linq
Imports System.Collections
Public Class MyPanel
Inherits Panel
' 选择模式,相交还是包含
Enum SelectMode
Intersects
Contains
End Enum
Dim down As New Point(-1, -1)
Dim rect As Rectangle
Dim selected As New List(Of Control)
Dim editting As IEnumerable(Of Control)
Dim mode As SelectMode = SelectMode.Contains
Dim shift, alt As Boolean
Public Sub New()
Me.DoubleBuffered = True
End Sub
Protected Overrides Sub OnMouseDown(e As MouseEventArgs)
MyBase.OnMouseDown(e)
down = e.Location
editting = selected.ToArray().ToList()
OnMouseMove(e)
End Sub
Protected Overrides Sub OnMouseMove(e As MouseEventArgs)
MyBase.OnMouseMove(e)
If e.Button = Windows.Forms.MouseButtons.Left Then
Dim loc As New Point(Math.Min(down.X, e.X), Math.Min(down.Y, e.Y))
Dim size As New Size(Math.Abs(down.X - e.X), Math.Abs(down.Y - e.Y))
rect = New Rectangle(loc, size)
Dim cs As New List(Of Control)
For Each c In Controls
cs.Add(c)
Next
Dim a = cs.Where(Function(n As Control) (mode = SelectMode.Contains And rect.Contains(n.Bounds)) Or (mode = SelectMode.Intersects And rect.IntersectsWith(n.Bounds)))
If shift Then editting = a.Union(selected) Else If alt Then editting = selected.Except(a) Else editting = a
Invalidate()
End If
End Sub
Protected Overrides Sub OnMouseUp(e As MouseEventArgs)
MyBase.OnMouseUp(e)
down = New Point(-1, -1)
selected = editting.ToList()
editting = Nothing
Invalidate()
End Sub
Protected Overrides Function ProcessKeyPreview(ByRef m As Message) As Boolean
Dim KeyCode As Keys = CInt(m.WParam) And CInt(Keys.KeyCode)
Dim d As Boolean
If m.Msg = H100 Or m.Msg = H104 Then d = True Else If m.Msg = H101 Or m.Msg = H105 Then d = False Else Return MyBase.ProcessKeyPreview(m)
If KeyCode = Keys.ShiftKey Then
shift = d
ElseIf KeyCode = Keys.Menu Then
alt = d
End If
Return MyBase.ProcessKeyPreview(m)
End Function
Protected Overrides Sub OnPaint(e As PaintEventArgs)
MyBase.OnPaint(e)
For Each c As Control In IIf(editting Is Nothing, selected, editting)
e.Graphics.DrawRectangle(New Pen(Color.Gray) With {.DashStyle = Drawing2D.DashStyle.DashDot}, c.Left - 1, c.Top - 1, c.Width + 1, c.Height + 1)
Next
If (down.X 0) Then e.Graphics.DrawRectangle(New Pen(Color.Gray) With {.DashStyle = Drawing2D.DashStyle.DashDot}, rect)
End Sub
End Class
Q2: vb.net调用C#类 VB.NET项目中怎样调用C#写的类(没有编译的,.CS文件)?
我是我自己的看门狗。
走,我站在门口,
吃,我接受我提供的,
躺,我蜷曲呼呼在地板上,
沉重的头搁在我的爪子之间。
Q3: 用VB.NET写CS架构的程序,多用户数的网络版,需要写服务端吗?服务端具体都做那些工作呢?
这个不一定,看具体是做什么用,如果只是简单的数据库做服务器端 就不用。但是如果是复杂的就需要。
如果只是读写数据库就不用socket ,软件本身和数据库就有通道连接。除非想在数据库和软件之间增加一个自己的中间层
Q4: VB.net如何设置程序运行时最先打开的窗体?
你是不是用的Visual Studio来开发的?如果是,这样操作:打开 项目 菜单 中的 XXX属性,在弹出的属性页选择最上面那个 应用程序 标签,里面有个启动窗体,你选择一下就可以了。
如果你不是用的visual Studio来开发的,那么可以考虑把另外一个窗口的visible属性先设置为false或者把你要显示的窗口改为对话框的形式,大小比另外一个窗口大一点或者一样(即 模态窗口,必须关闭才能继续操作),这样都可以实现你要的效果。
Q5: 关于VB.NET连接字符串
Dim da As String = "SELECT Count(检测项目) FROM b where 检测项目='cc'"
这句写错啦,你直接传送的是检测项目为字符串"cc"的参数,并不是你程序写的CC参数
改为:
Dim da As String = "SELECT Count(检测项目) FROM b where 检测项目='" cc "'"
建议通过程序组织的sql语句可以通过msgbox da 弹出来看看,这样你较容易查出是什么错误,较长的就用textbox1.text=da来看了,不过记得设置断点"exit sub"
使用ACCESS数据库的日期列比较,应为:
"select * from 表 where 日期列=" "#" cdate(textbox1.text) "#"
注意前后两个“#”号
使用sqlserver
"select * from 表 where 日期列=" "'" cdate(textbox1.text) "'"
当然日期格式要注意,如长短日期等。
日期期间:between 小日期 and 大日期(记得加#号)
vb.netcs的介绍就聊到这里吧,感谢你花时间阅读本站内容,更多关于、vb.netcs的信息别忘了在本站进行查找喔。







