Click here to Skip to main content
16,015,072 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionInformation from one pgm to another Pin
henur16-Jan-07 2:12
henur16-Jan-07 2:12 
AnswerRe: Information from one pgm to another Pin
Dave Kreskowiak16-Jan-07 5:26
mveDave Kreskowiak16-Jan-07 5:26 
GeneralRe: Information from one pgm to another Pin
henur16-Jan-07 10:04
henur16-Jan-07 10:04 
GeneralRe: Information from one pgm to another Pin
shreekar16-Jan-07 17:59
shreekar16-Jan-07 17:59 
GeneralRe: Information from one pgm to another Pin
Dave Kreskowiak17-Jan-07 5:38
mveDave Kreskowiak17-Jan-07 5:38 
QuestionConnection string in module? Pin
priya_p23316-Jan-07 1:56
priya_p23316-Jan-07 1:56 
AnswerRe: Connection string in module? Pin
Guffa16-Jan-07 3:48
Guffa16-Jan-07 3:48 
QuestionCell alignment in DataGridView [modified] Pin
DA_Loring16-Jan-07 1:33
DA_Loring16-Jan-07 1:33 
Some columns on the grid need to be centred. I have set the columns to centred and this works OK, except that on the column where the cell is repainted a different colour based on the cell value, the centering is lost.

I have set up some cell formats to change the cell alignment within the CellPainting event:-

formatCell.Alignment = StringAlignment.Center
formatCell.LineAlignment = StringAlignment.Center
formatCell.FormatFlags = StringFormatFlags.NoClip

Using the code below I get the value in the extreme top left of the cell instead of the centre.

If nsCellValue = 0 Then
'This is a full outage and is shown Red
' Erase the cell.
e.Graphics.FillRectangle(redBackBrush, e.CellBounds)

' Draw the grid lines (only the right and bottom lines;
' DataGridView takes care of the others).
e.Graphics.DrawLine(gridLinePen, e.CellBounds.Left, _
e.CellBounds.Bottom - 1, e.CellBounds.Right - 1, _
e.CellBounds.Bottom - 1)
e.Graphics.DrawLine(gridLinePen, e.CellBounds.Right - 1, _
e.CellBounds.Top, e.CellBounds.Right - 1, _
e.CellBounds.Bottom)

' Draw the text content of the cell
If Not (e.Value Is Nothing) Then
e.Graphics.DrawString(CStr(nsCellValue), e.CellStyle.Font, _
Brushes.Black, e.CellBounds.X + 2, e.CellBounds.Y + 2, _
formatCell)
End If
e.Handled = True

etc...
The formatCell in the Drawstring property just does not seem to work. Any ideas on what I am doing wrong would be appreciated.
Confused | :confused:





-- modified at 7:40 Tuesday 16th January, 2007

David Loring
!! Keep Music Live !!


-- modified at 7:40 Tuesday 16th January, 2007
AnswerRe: Cell alignment in DataGridView Pin
Dave Kreskowiak16-Jan-07 5:39
mveDave Kreskowiak16-Jan-07 5:39 
GeneralRe: Cell alignment in DataGridView Pin
DA_Loring16-Jan-07 22:45
DA_Loring16-Jan-07 22:45 
QuestionGRID Pin
AkshatSharma16-Jan-07 1:08
AkshatSharma16-Jan-07 1:08 
QuestionHow can I Download multiple file in ftp with .net Pin
Pravat Maskey16-Jan-07 0:41
Pravat Maskey16-Jan-07 0:41 
AnswerRe: How can I Download multiple file in ftp with .net Pin
shreekar16-Jan-07 0:54
shreekar16-Jan-07 0:54 
QuestionPrint preivew Pin
Socheat.Net16-Jan-07 0:10
Socheat.Net16-Jan-07 0:10 
AnswerRe: Print preivew Pin
shreekar16-Jan-07 17:41
shreekar16-Jan-07 17:41 
QuestionRe: Print preivew [modified] Pin
shreekar16-Jan-07 0:58
shreekar16-Jan-07 0:58 
QuestionListbox name edit Pin
Ultima Reborn15-Jan-07 23:58
Ultima Reborn15-Jan-07 23:58 
AnswerRe: Listbox name edit Pin
Dave Kreskowiak16-Jan-07 5:45
mveDave Kreskowiak16-Jan-07 5:45 
GeneralRe: Listbox name edit Pin
Ultima Reborn16-Jan-07 7:26
Ultima Reborn16-Jan-07 7:26 
GeneralRe: Listbox name edit Pin
Dave Kreskowiak16-Jan-07 7:56
mveDave Kreskowiak16-Jan-07 7:56 
GeneralRe: Listbox name edit Pin
Ultima Reborn16-Jan-07 8:43
Ultima Reborn16-Jan-07 8:43 
GeneralRe: Listbox name edit Pin
Dave Kreskowiak16-Jan-07 9:22
mveDave Kreskowiak16-Jan-07 9:22 
QuestionValidate All controls on form Pin
priya_p23315-Jan-07 23:09
priya_p23315-Jan-07 23:09 
AnswerRe: Validate All controls on form Pin
shreekar16-Jan-07 1:03
shreekar16-Jan-07 1:03 
Questiontheatre booking system [modified] Pin
kendo1715-Jan-07 22:50
kendo1715-Jan-07 22:50 

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.