|
And I think your missing the purpose of that Index parameter.
Private Sub cboField_KeyPress(Index As Integer, KeyAscii As Integer)
Select Case Index
Case 1:
' The first combobox fired KeyPress
MsgBox "Hi from ComboBox 1!"
Case 2:
' The second combobox
MsgBox "Hi from ComboBox 2!"
Case 3:
MsgBox "Hi from ComboBox 3!"
End Select
All you had to do was check the value of Index...
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Wow, it works !!!!!!!!!
you are a Genius Dave! Thanks a million and have a nice weekend
Best regards,
Augusto
|
|
|
|
|
I use ColouredDataGridTextboxColumn for my Datagrid.I override its Paint Method and apply colur to entire row depending upon a column value.
It works Fine till this Point.
The Problem Is:when i Click on the Datagrid Header to sort the colmn(this grid has default sorting enabled)the rows chage but the colour does not change according to new values.
Will be very Thankful to anyone who can provide solution for this
|
|
|
|
|
Hi,
I also used a prepaint routine in a project. The following routine will pre paint a cell either red or blue depending on if it's positive or negative.
I'm sure you could use something like this to fix your problem, if you refresh the grid the colours will be repainted again in the correct location.
See below......
Private Sub grdAdjustments_RowPrePaint(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewRowPrePaintEventArgs) Handles grdAdjustments.RowPrePaint
Dim tmpCellPos As New DataGridViewCellStyle()
Dim tmpCellNeg As New DataGridViewCellStyle()
tmpCellPos.BackColor = Color.FromArgb(30, 124, 230)
tmpCellNeg.BackColor = Color.FromArgb(253, 92, 65)
Try
If Me.grdAdjustments.Rows(e.RowIndex).Cells(2).Value > 0 Then
grdAdjustments.Rows(e.RowIndex).Cells(2).Style = tmpCellPos
Else
grdAdjustments.Rows(e.RowIndex).Cells(2).Style = tmpCellNeg
End If
Catch ex As Exception
ErrorCodeLog(ex.Message, ex.InnerException, gstrACTIVEFORM)
End Try
End Sub
Hope this helps
John
|
|
|
|
|
hi members,
Can somebody guide me that how to print the contents of webbrowser. I achieve this is vb 6.0 through but execwb not available in .net.
Thanks
Regards
|
|
|
|
|
Hi all,
I'm new in visual studio2005 and software development for PPC, but I use to make lot of microcontrolled harwares so I'm not an absolutelly newbyte for different Basic programing languages.
Now I would like to communicate with a serial device using my PDA with Windos mobile 2003.
Could somebody send me a short sample project vritten in VB how to enumerate PPC's serial ports in a listbox or so, selecting serial port, setting the baudrate, opening and closing the serial port, sending and receiving some text or any kind of data from and into a textbox.
Many thanks in advance for any help!
|
|
|
|
|
You'd probably get a better answer in the Mobile Development[^].
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi Members,
I need some info regarding simple printing a file in .net.
Regards
|
|
|
|
|
Ali 110 wrote: I need some info
And that would be ....?
Print what file? A text file? A PDF file? Word document? What? Do you want your application doing the printing or are you trying to get the application that wrote the file to do the printing? What part of the printing process are you having a problem with?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Thanks for reply
I need to print html & text files
I want to print these files in .net without using complications of PrintPage event.
Regards
|
|
|
|
|
Well, you can cheat and do it. Drop a WebBrowser control on your form, load the document you want to print into it, then call the WebBrowser's Print method.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi buddies,
how to convert date in dd/mm/yy format in vb.net.
I am using dateadd function to change my months to one month back.
dateadd("m","-1",datetime.today).
It gives me date as 10 13 2006.
I want it in 13/10/2006 format
Thanks in advance
Satishk
|
|
|
|
|
You van use ToString
dateVar.ToString("dd/MM/yy")
|
|
|
|
|
Sir
it's not giving the dtpicker.tostring
actually there is no method in dtpicker the "tostring" one.
so how can i do that?
kindly help me.
Have a nice day
Withe Regards
Alok Singh
|
|
|
|
|
sir Actually i am using datepicker so in that situation how can i convert
that value of "month/day/year" into "dd/mm/yy" format
Kindly hel me
Withe Regards
Alok Singh
|
|
|
|
|
You can use
dtpSomething.Value.ToString("dd/MM/yy")
|
|
|
|
|
Hello,
Try : Format(dateadd("m",-1,datetime.today),"dd/MM/yyyy")
|
|
|
|
|
|
First of all, you are confusing dates with strings. A date value doesn't have a format at all. The format is applied when you convert the date value into a string.
If you get a format that you don't want, it's because you have converted the date to a string without specifying what format you do want. If there is no format specified, it uses the format of the current culture.
When converting a date to a string, you can specify a specific format:
s = daDate.ToString("dd/MM/yyyy")
You could also specify a DateTimeFormatInfo or a CultureInfo object for the culture that uses the format that you want.
Tip: Use the methods of the DateTime structure instead of the VB6-ish methods:
daDate = DateTime.Today.AddMonth(-1)
---
b { font-weight: normal; }
|
|
|
|
|
Hi
how can i store a Datepicker value in a text variable?
i m using a datepicker1 n i want to convert into a text variable?
kidly help me
-with regards
Withe Regards
Alok Singh
|
|
|
|
|
You can use tostring
dtpTextStr= DateTimePicker1.Value.ToString()
or
dtpTextStr= DateTimePicker1.Text()
|
|
|
|
|
Hi all,
We have a program where in we write code to activate a AS400 machine and connect to it ,so that we have to get some text file from there and paste into our system.So anyone pls suggest the code pleaseeeeeeeeee.
Thanks in advance
Preethi
preethishivbaba
|
|
|
|
|
How is this text file exposed on the AS400?? Is it available via a web page? FTP server? Telnet? Without knowing how this file is made available, it's impossible to tell you how to get at it.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Hi
Any help or advice is appreciated. I am very new to programing VB.net 2005.
I have a table name Product in SQL2005 database. The product table has productName and Price. If the user select one of the product from combo box, I want to see the price only for that product listed in the text box.
Thanks for your help
TT
|
|
|
|
|
It depends on how you've written your code and database. But, in general, you have to get the Primary Key of the record that's selected in the ComboBox and use another SQL query to lookup the price associated with that record. You did put in ID column in your Product table, didn't you?
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|