vb.net

RichTextBox flickers while coloring words

允我心安 提交于 2021-02-19 05:25:10
问题 I have a RichTextBox. lets say I want to draw every word "test" in the text. My problem is not to find the "test" in the text, My problem is when I color the word I can see the RichTextBox Selection process. My color function: Private Sub DrawSubPart(ByVal StartIndex As Integer, ByVal EndIndex As Integer, ByVal col As Color) Dim save As Integer = TextScreen.SelectionStart TextScreen.SelectionStart = StartIndex 'Here I can see the selection, And I dont want to see it. TextScreen

WmiMonitorID - Converting the results to ASCII

陌路散爱 提交于 2021-02-19 04:18:44
问题 Am attempting to query the serial number and the model of the monitor. I managed to use the WMI code creator to generate the below code: Try Dim MInfo As New ManagementObjectSearcher("root\WMI", "SELECT * FROM WmiMonitorID") For Each Monitor In MInfo.Get() If Monitor("SerialNumberID") Is Nothing Then MsgBox("NA") Else Dim arrSerialNumberID As UInt16() arrSerialNumberID = Monitor("SerialNumberID") For Each arrValue As UInt16 In arrSerialNumberID Console.WriteLine("Serial: " & arrValue) Next

Add tabs to TabControl from another form

旧巷老猫 提交于 2021-02-19 03:50:27
问题 This is freaking me out, and if this is possible I would gladly appreciate the help. I am a C# developer but have to do this in VB.NET. So C# answers accepted as well. I have a tab control on a form. This control does not have any tabs in it yet. When the form loads, it loads a "Start" page. It adds the tab "tbpStart" and loads a form onto the tab page "frmStart". On this start page, I have many Radio Buttons. When I click on one radio button, it should load other tabs on the main form. The

VB.Net Datagridview to Datatable

一曲冷凌霜 提交于 2021-02-19 02:51:06
问题 I wanted to create a datatable based from a 5 column datatable. Also, I would like to remove the last column (it is an image column). Basically, what I wanted to have is ( a pseudocode ) datatable = datagridview.datasource I have tried this, but failed: Dim dt As New DataTable dt = TryCast(dgvCarAccidentInjury.DataSource, DataTable) And this, Dim dt As New DataTable(dgvCarAccidentInjury.DataSource) Again I failed. I saw this on the c# column but I don't know how to convert it to vb.net, maybe

Indexer named “Item” required by interface but not possible to implement?

心已入冬 提交于 2021-02-19 02:37:20
问题 I'm trying to implement an interface of a class in the ESPRIT api that requires an indexer named "Item." (I'm guessing the interface came from VB.NET but I don't have the source.) Obviously the "Item[index]" indexer is auto-generated by the compiler by default but I'm getting the following errors: I realize [System.Runtime.CompilerServices.IndexerName("Item")] is redundant; it's simply there to demonstrate explicitly that Item is generated and the error remains. Attempting to implement public

Winforms Could not load file or assembly 'Microsoft.ReportDesigner, Version=10.0.0.0' in VS2012

假如想象 提交于 2021-02-18 20:15:10
问题 This is driving me nuts. I have a winforms app build in VS2012 targeting .NET 4.5. On a few forms I have to use a ReportViewer. At first I worked with ReportViewer for 2012 (version 11.0.0.0). All working fine. However, my client doesn't want to install this version on their workstations yet because this version uses the CLR Types SQL 2012. Don't ask me why, but I have to accept this for now. So I decided to use the previous reportviewer version 10.0.0.0. I downloaded the redistributional

how to customize a progress bar using vb.net

那年仲夏 提交于 2021-02-18 19:48:39
问题 I was trying to creating a progress bar that was color coded in relation to the value. For example, from 0-35, the progress bar should be red-colored and above 35, green colored. Any idea how I can go about doing it? If ProgressBar1.Value >= 35 Then ProgressBar1.BackColor = Color.Green Else ProgressBar1.BackColor = Color.Red End If P.S in the same progressbar, both the colors have to shown based on the values 回答1: You need to change settings on this one. Go to Project --> [WindowsApplication]

how to customize a progress bar using vb.net

ⅰ亾dé卋堺 提交于 2021-02-18 19:44:16
问题 I was trying to creating a progress bar that was color coded in relation to the value. For example, from 0-35, the progress bar should be red-colored and above 35, green colored. Any idea how I can go about doing it? If ProgressBar1.Value >= 35 Then ProgressBar1.BackColor = Color.Green Else ProgressBar1.BackColor = Color.Red End If P.S in the same progressbar, both the colors have to shown based on the values 回答1: You need to change settings on this one. Go to Project --> [WindowsApplication]

How do I make a copy of an SQL Server database and connect to it?

廉价感情. 提交于 2021-02-18 19:42:06
问题 I'm working on vb.NET 2013 and SQL server 2008R2. I have this situation to resolve: I have a database "DB1". I want to create a copy of this database on the same SQL server with another name "DB2", and after make this database ready to connect. How can I do this through code from Vb.NET? 回答1: Check out this tech net link for restore with new file names. http://technet.microsoft.com/en-us/library/ms190447(v=sql.105).aspx. Take a backup of database one (DB1). Verify backup is valid. Get correct

How do I make a copy of an SQL Server database and connect to it?

你离开我真会死。 提交于 2021-02-18 19:41:42
问题 I'm working on vb.NET 2013 and SQL server 2008R2. I have this situation to resolve: I have a database "DB1". I want to create a copy of this database on the same SQL server with another name "DB2", and after make this database ready to connect. How can I do this through code from Vb.NET? 回答1: Check out this tech net link for restore with new file names. http://technet.microsoft.com/en-us/library/ms190447(v=sql.105).aspx. Take a backup of database one (DB1). Verify backup is valid. Get correct