20,278 Topics

Member Avatar for
Member Avatar for angel06

Option Explicit Dim score As Integer Private Sub Command1_Click() Dim Values(3) As ColorConstants Values(0) = vbRed Values(1) = vbBlue Values(2) = vbGreen Dim RandomNumber As ColorConstants RandomNumber = Values(Rnd * 2) Label1.BackColor = RandomNumber Randomize End Sub Private Sub Command2_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As …

Member Avatar for angel06
0
196
Member Avatar for behemothdave

Alright so essentially I need to create a class that houses the methods and then call the methods in the form but I can't seem to find out what the right code is to call it. I think there may be an issue with the conversion from a double to …

Member Avatar for Albireo6972
0
331
Member Avatar for Dili1234

hi i'm doing a vb application to inventory mangement system Private Sub AppendItem(ByVal Major As String) myConnection = New SqlConnection(connectionstring) myConnection.Open() Dim TempData As New DataTable myCommand1 = New SqlCommand("Select Departement,Suject_Name From Major Where MajorName='" & ComboBox1.SelectedItem & "'", myConnection) myCommand1.ExecuteNonQuery() 'sqlcmd = New SqlCommand("SELECT P_Id,P_Selling_Price FROM Product_Details WHERE P_Id='" …

0
82
Member Avatar for sanjeewa.abeywardana

How can I **convert this code to csharp code**, seems to be simple but little confused. Dim Temperature As Integer = 30 Select Case Temperature Case 31 Console.WriteLine("stay in bed") Case 32 Console.WriteLine("play the lottery") Case Else Console.WriteLine("Just read the newspaper") End Select

Member Avatar for sanjeewa.abeywardana
0
86
Member Avatar for New22010

Formatting a date, In VB6 I could specify the a date that was so many days from today and change the format of the output in a nice and easy statement: Format(Now - 1, "yyyyMMdd"). I am trying to learn vb2010 and am getting an error on that statement: *Operator …

Member Avatar for New22010
0
199
Member Avatar for sythez.orgz

Hey guys, can you help me on my problem. The program (RFID) im working on can only read one data at a time from serial port. What i need is for it to read 5 data at a time. Scenario is this, it will read 5 RFID tags at a …

0
59
Member Avatar for Nutster

I am pretty new to programming in VB.Net, but I have been programming in other languages for a couple of decades now, including VB5/6 and C++. When I am using a **Try** - **Catch** block to handle exceptions, what is the point of a **Finally** section? Wouldn't it be just …

Member Avatar for Reverend Jim
0
291
Member Avatar for Captain_Jack

Hello there! This forums has helped me a lot to learn programming now I need your help again. I'm try to figure out a way to create a folder based on users input in Textbox on desktop. Public Class Form1 Dim username As TextBox Private Sub TextBox1_TextChanged(ByVal sender As System.Object, …

Member Avatar for Captain_Jack
0
323
Member Avatar for raficomps

> How to format date when date control is used any idea........... it should display like 01/01/2012, zero should be append before day and month while its displaying not like 1/1/2012..... i have tried myDate=Format(myDate, "#0") And myDate= Format(myDate, "dd/mm/yyyy")

Member Avatar for Maligui
0
122
Member Avatar for priyamtheone

I built a ClassLibrary where I have created my custom form component (let's say MyForm) that inherits from the Form class. I added the ClassLibrary to my actual WinForms project. Now when I add an inherited form based on MyForm to my project through the 'Add New Item' dialog box …

Member Avatar for priyamtheone
0
319
Member Avatar for priyamtheone

Ensure ApplyVisualStyles is enabled in your system. Place a ToolStripProgressBar on a toolstrip, run your application and minimize the form. Now change the theme of your computer to Windows Classic and restore the form. See the interior of the ToolStripProgrssBar becomes black. It doesn't even change if you refresh the …

Member Avatar for priyamtheone
0
373
Member Avatar for priyamtheone

I am rendering a toolstrip with a CustomRenderer that inherits from ToolStripProfessionalRenderer. The concept is that I want the color of the arrow of the toolstrip items to be white in all cases except selection. When it is selected the color should be black. In my code below all arrows …

Member Avatar for priyamtheone
0
398
Member Avatar for abubakar.hamza.520

Hi, am tring to see my digital pen works with the Pegasus .net Sdk in vb2010 well i have enable the class and it wirte but one thing that make life hard is coordination of pen (Y,X) which i need to start from a given point on my inedit control …

0
48
Member Avatar for mr3army

Hey guys tried a few things but Im clueless to stuff like regex and I really need this compontent to my project :( THIS NEEDS TO BE EXTRACTED - this changes on each refresh I need that part of the data to be added to a list view Please help …

Member Avatar for mr3army
0
2K
Member Avatar for HibaPro

i have binding datagridview with 27 rows , i need to add these row to sqlserver table with other field how i can do that by insert statment???

Member Avatar for HibaPro
0
214
Member Avatar for jerviejeb

**Hi all. Im new to visual basic. im using vb 2008 express edition what im trying to do is take everything in my database and put it in my datagridview. The datagridview can be edited. From there, i want to make the changes then save them later. So my question …

Member Avatar for kRod
0
115
Member Avatar for Dili1234

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim pid As String = ComboBox1.SelectedItem myConnection = New SqlConnection(Module1.connectionString) myConnection.Open() newq.Text = Val(TextBox2.Text) - Val(TextBox1.Text) Dim majortable As SqlCommand = New SqlCommand("Update Product_Details Set Quantity ='" & newq.Text & "' WHERE P_ID='" & pid & " '", …

0
75
Member Avatar for smitty68503

Try Dim I As Integer For I = 0 To DataGridView1.Rows.Count - 1 Dim ordernumber As String = DataGridView1.Rows(I).Cells(0).Value Dim repairinvoice As String = DataGridView1.Rows(I).Cells(1).Value Dim itemname As String = DataGridView1.Rows(I).Cells(2).Value Dim orderedquantity As String = DataGridView1.Rows(I).Cells(3).Value Dim itemcost As String = DataGridView1.Rows(I).Cells(4).Value Dim saleprice As String = DataGridView1.Rows(I).Cells(5).Value Dim …

Member Avatar for Maligui
0
3K
Member Avatar for Nutster

I have recently started coding in VB.Net and started using the Try-Catch style of exception handling available in .Net, which I admit is very similar to the exception handling of C++, so it is not all that unfamiliar. In my VB6 code, which I have been using up till now …

Member Avatar for Maligui
0
3K
Member Avatar for megax24505

Is it possible to make a text file or separate class file that could be imported as lines of code. e.g. I have this simple line of code: Dim x = 0 messagebox.show(x) Import(text file or other file) 'run the code from the other file 'resume code in this file …

Member Avatar for Maligui
0
202
Member Avatar for Sahil89

Hi, Recently I was working in photoshop, And photoshop is really great application. After using it for weeks, I am thinking about learning the logic behind the way it works. I tried few articles which was just about converting image to black n white, matching two exactly same images etc. …

Member Avatar for Maligui
0
148
Member Avatar for Gé48

Hi all, I build a scrolling text that starts running when I start up my Computer. I can stop it by clicking on it, no problem. Is it also possible to stop it when I start up another programm ?

Member Avatar for Gé48
0
196
Member Avatar for razree

Hi all I have a quite complex problem and I don't exactly know how to "step into it" so I really need your help. Little briefing: lets say I go on a business trip. My company gives me up to 2 advances in different currencys (but there also could be …

Member Avatar for Nutster
0
167
Member Avatar for ulasoc

Is it possible to delete non empty folder in web? I cant delete it using this code as long as its non empty folder. I can delete files under the folder but folder may consist sub folders too. Whats is the simple way to do this? Dim clsRequest As System.Net.FtpWebRequest …

Member Avatar for Nutster
0
154
Member Avatar for srm2010

I am trying to update column having smallmoney datatype through datagridview and then clciking update button. I am not getting any errors but data is not updating at all.Is it becos of datatype problem?Other columns are getting updated. Can any one tell me what is a problem? Thanks in advance...

Member Avatar for nmaillet
0
67
Member Avatar for swathys

Hi. i have an application which send email upon submission of the loan application. if the recepient email ID is yahoo or hotmail i dont have any problem but when the email ID is **gmail. it treated it as spam.** How do i get rid of this. Please help me …

Member Avatar for Reverend Jim
0
149
Member Avatar for Gus_19

Right now if a user closes the form (either by clicking 'X' or chosing exit from a menu option) and changes are detected in the form, a messagebox will display asking the user if they would like to save any changes. The user has the option of clicking "yes, no …

Member Avatar for Reverend Jim
0
375
Member Avatar for bLuEmEzzy
Member Avatar for willjohn.wrar393

Hi I want to Clarify what is the Problem of this code? if you feel free to answer Thanks alot... Private Sub addakoordr_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles addakoordr.Click Dim tr As String = tID.Text Dim qo As String = tquanOrder.Text Dim arw As String = cdateselec.Text …

Member Avatar for daniel955
0
103
Member Avatar for khair.ullah

ASALAM ALIKUM Dear !... I'm doing INVENTORY PROJECT... I'm using Ms sql 2005 as BACK-END... My tables are PURCHASE and SALES... In PURCHASE table, fields are CODE(primary key), PRICE, DATE, TOTAL, QTY... when I'm entering datas in form and when i click submit, the data stored on database... but when …

Member Avatar for daniel955
0
229

The End.