Click here to Skip to main content
15,898,035 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to retrieve a value from application config file? [modified] Pin
JUNEYT19-Mar-07 3:17
JUNEYT19-Mar-07 3:17 
AnswerRe: How to retrieve a value from application config file? Pin
coolestCoder20-Mar-07 1:21
coolestCoder20-Mar-07 1:21 
GeneralRe: How to retrieve a value from application config file? Pin
JUNEYT20-Mar-07 2:10
JUNEYT20-Mar-07 2:10 
AnswerRe: How to retrieve a value from application config file? Pin
JenisysJohn11-Apr-07 8:14
JenisysJohn11-Apr-07 8:14 
GeneralRe: How to retrieve a value from application config file? Pin
JenisysJohn11-Apr-07 8:15
JenisysJohn11-Apr-07 8:15 
QuestionRetrieving information (urls, ...) about temporary internet files Pin
haleemha19-Mar-07 0:55
haleemha19-Mar-07 0:55 
QuestionChange color at run time Pin
nawalage18-Mar-07 23:07
nawalage18-Mar-07 23:07 
AnswerRe: Change color at run time Pin
Kschuler19-Mar-07 9:21
Kschuler19-Mar-07 9:21 
If you are talking about a GridView in a web project:
Access the RowDataBound event of the grid and
If the e.Row.RowType = DataControlRowType.DataRow Then <br />
    e.Row.BackColor = Color.Red<br />
End If


If you talking about a DataGridView in a windows forms project:
If you want to change row colors specifically to alternate row colors, that feature is already built in. Just put something like this in your form load event:
        Dim styleDefault As New DataGridViewCellStyle()<br />
        styleDefault.BackColor = Color.White<br />
        styleDefault.ForeColor = Color.Black<br />
        styleDefault.SelectionBackColor = Color.White<br />
        styleDefault.SelectionForeColor = Color.Black<br />
        dgvMyGrid.DefaultCellStyle = styleDefault<br />
<br />
        Dim styleAlternate As New DataGridViewCellStyle()<br />
        styleAlternate.BackColor = Color.LightGoldenrodYellow<br />
        styleAlternate.ForeColor = Color.Black<br />
        styleAlternate.SelectionBackColor = Color.LightGoldenrodYellow<br />
        styleAlternate.SelectionForeColor = Color.Black<br />
        dgvMyGrid.AlternatingRowsDefaultCellStyle = styleAlternate


If you want to access a specific row and highlight it, just access the style directly: (intMyRowIndex is the row index of the cell you wish to highlight)

        Dim styleTemp As New DataGridViewCellStyle<br />
        styleTemp.BackColor = Color.Red<br />
        styleTemp.ForeColor = Color.Black<br />
        styleTemp.SelectionBackColor = Color.Red<br />
        styleTemp.SelectionForeColor = Color.Black<br />
<br />
        dgvMyGrid.Rows(intMyRowIndex).DefaultCellStyle = styleTemp


Hope this helps.
QuestionRe: Change color at run time Pin
nawalage19-Mar-07 21:36
nawalage19-Mar-07 21:36 
QuestionHow to convert existing C# Windows Application to C# Web Application.. Pin
MPS_DotNet18-Mar-07 21:10
MPS_DotNet18-Mar-07 21:10 
AnswerRe: How to convert existing C# Windows Application to C# Web Application.. Pin
Colin Angus Mackay19-Mar-07 0:52
Colin Angus Mackay19-Mar-07 0:52 
AnswerRe: How to convert existing C# Windows Application to C# Web Application.. Pin
Dave Kreskowiak19-Mar-07 1:40
mveDave Kreskowiak19-Mar-07 1:40 
Questionconvert to excel format Pin
Amit Sk Sharma18-Mar-07 19:09
Amit Sk Sharma18-Mar-07 19:09 
AnswerRe: convert to excel format Pin
Tirthadip18-Mar-07 19:44
Tirthadip18-Mar-07 19:44 
QuestionClose the word document by using controlbox Pin
Nanda160518-Mar-07 19:07
Nanda160518-Mar-07 19:07 
QuestionI need some advice from experts about integrating activation code implementation. Pin
JUNEYT18-Mar-07 11:19
JUNEYT18-Mar-07 11:19 
AnswerRe: I need some advice from experts about integrating activation code implementation. Pin
Christian Graus18-Mar-07 11:45
protectorChristian Graus18-Mar-07 11:45 
GeneralRe: I need some advice from experts about integrating activation code implementation. Pin
JUNEYT18-Mar-07 12:31
JUNEYT18-Mar-07 12:31 
GeneralRe: I need some advice from experts about integrating activation code implementation. Pin
Johan Hakkesteegt19-Mar-07 1:17
Johan Hakkesteegt19-Mar-07 1:17 
QuestionMake into a loop? Pin
harveyhanson18-Mar-07 10:12
harveyhanson18-Mar-07 10:12 
AnswerRe: Make into a loop? Pin
Christian Graus18-Mar-07 10:23
protectorChristian Graus18-Mar-07 10:23 
QuestionThe AE (198) character Pin
RX Maverick18-Mar-07 6:35
RX Maverick18-Mar-07 6:35 
AnswerRe: The AE (198) character Pin
Guffa18-Mar-07 8:24
Guffa18-Mar-07 8:24 
Questionfingerprint pattern matching Pin
amruta_muley17-Mar-07 17:34
amruta_muley17-Mar-07 17:34 
AnswerRe: fingerprint pattern matching Pin
Guffa18-Mar-07 2:56
Guffa18-Mar-07 2:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.