|
HI All - I few days ago I posed a question about this and got an answer, but in the end this particular method did not work for me. I have managed to find a way to do it and I thought I would share it. Hope this helps someone.
In the CellPainting event..........
Dim greenBackBrush As New SolidBrush(Color.LightGreen)
Dim gridBrush As New SolidBrush(Me.dgvAvail.GridColor)
Dim gridLinePen As New Pen(gridBrush)
Dim nsCellValue As Single = 0
Dim nsMaxValue As Single = 0
Dim sf As New StringFormat
sf.FormatFlags = StringFormatFlags.NoWrap Or StringFormatFlags.FitBlackBox
sf.LineAlignment = StringAlignment.Center
sf.Alignment = StringAlignment.Center
sf.Trimming = StringTrimming.None
'This cell shown Green
' Erase the cell.
e.Graphics.FillRectangle(greenBackBrush, 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)
If Not (e.Value Is Nothing) Then
Dim g As Graphics = e.Graphics
Dim r As System.Drawing.Rectangle
r.Width = (e.CellBounds.Right - 2) - (e.CellBounds.Left + 2)
r.Height = (e.CellBounds.Bottom - 2) - (e.CellBounds.Top + 2)
r.X = e.CellBounds.X + 2
r.Y = e.CellBounds.Y + 2
e.Graphics.TextRenderingHint = Drawing.Text.TextRenderingHint.AntiAliasGridFit
e.Graphics.DrawString(CStr(nsCellValue), e.CellStyle.Font, Brushes.Black, r, sf)
r = Nothing
End If
See the article for the full subroutine code
-- modified at 13:41 Saturday 20th January, 2007
David Loring
!! Keep Music Live !!
|
|
|
|
|
Hello,
My customer wants to be able to update the program and download only the updates from the server.
The customer wants to install the application and then download updates when they are available. And install them without having to reinstall the program.
I started using the clickonce which works ok for this situation. However, the customer did not like this as it always installs in the default documents and setting directory, and the updates that are downloaded as the same size as the initial program size. As the updates are only small the customer only wants to download those updates so it will be quick to download and quick to install.
Is there another method to be able to do this, maybe some free third party, or can you configure the MSI to do this.
The customer would like something like norton anti-virus where only the updates are installed only.
Many thanks in advance,
Steve
|
|
|
|
|
Well it really all depends on what your application does. If you have to re-write code blocks & recompile your app then a re-install is the way to go. Remember that anti-virus products more often than not download updates to the virus definition library which is not hard-coded into the app itself but rather a resource that the app makes use of.
What is it that needs to be updated in your app? Is it a resource? If so then, yes, I think you could give your customer what he wants.
|
|
|
|
|
Hello,
I am creating a PDA application using the CF 2.0 that will use a datagrid and will display time in one of the columns. The column is called "ScheduledTime" and in the sql server 2005 database the datatype is datetime.
I would like to format the time to display e.g. 21:45 24hr format.
I think the datagrid is very limited when using the CF for mobile applications as the property "format" doesn't exist for this. See my code below.
I am wondering is there another way to format time in a datagrid column using the CF 2.0.
<vbcode>Me.grdSupportContracts.DataSource = ds.Tables(0)
Dim dgtbc As DataGridTextBoxColumn
dgtbc = CType(Me.grdSupportContracts.TableStyles(0).GridColumnStyles(3), DataGridTextBoxColumn)
dgtbc.Format 'Doesn't have the format property
Many thanks in advance,
Steve
|
|
|
|
|
Hello there
I have a little question...
I have seen many little apps that can retrieve your internet connection's username and password, for connections like ADSL, Dial-Up, VPN's, e.t.c.
So I'd like to ask if anyone knows how can I do that myself using VS2005 ???
|
|
|
|
|
how can i get the processorId using VB.NET
|
|
|
|
|
|
Hi Dear all
Would you please give me a sample code(s) that show(s) using of filter method in vb.net to limit datasource data? I dont want to use SQL instructions to do that, so if you have any suggestions to do that with vb.net code please help me.
Many Thanks
|
|
|
|
|
Mansourgh wrote: I dont want to use SQL instructions to do that
Why not ? You're asking 'how do I do things the hard and slow way' ?
you can iterate over your collection and knock out the items you don't want. There's no other way I can think of, filtering with SQL is supported on the code end as well as on the DB, but you don't want to use SQL for some strange reason.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
I want to make a simple dictionary application that read the source from a delimited file, like using tab or comma and then store it into an array. I've tried using snippets, but it isn't working and doesn't look like what I want.
Please help me to make the code
Thanks
0011000011000001010101110100
|
|
|
|
|
my be you try like this
arr = split(stringToRead,urDelimeter)
|
|
|
|
|
Hello Evrybody...
I have a problem and I need help , I want to make a button to prevent writing in Textbox without changing its Backcolor or Forecolor and another button to open writing in the same Textbox without also changing the 2 previous colors .
thanks for all
-- modified at 14:28 Saturday 20th January, 2007
OK
when you use
Textbox1.Enaled = False
that will change the Font color and the back color of the textbox
I want to prevent writing in textbox without changing the font color or the back color
that is the problem
-- modified at 14:29 Saturday 20th January, 2007
soly
|
|
|
|
|
What do you mean? i don't understand it, please explain it more spesific.
|
|
|
|
|
I can't really understand your question, but you might try TextBox.Enabled = False .
Trinity: Neo... nobody has ever done this before.
Neo: That's why it's going to work.
|
|
|
|
|
Handle the keypress event of your textbox. If you've turned off input, then set ea.Handled = true in the event, this rejects all keypresses.
The user interface you're designing is quite user hostile. Windows shows a textbox differently if it won't work for a reason.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Ok then, if you want to do so, these are the way:
- set the accepttab property of the textbox into False.
- And also set the acceptreturn property into false, too
- Add a code that move the focus into another control, like a cancel button when user click on the textbox.
PS: You can't avoid backcolor and forecolor of the textbox changed while the control is disabled. If you don't want it, so don't disable the textbox.
Experience is the best teacher
|
|
|
|
|
helo developers. I wanted to develop simple word processor using local languages. I have tried. But I couldn't finish. If you can help me, please.
thanks.
It is me.
|
|
|
|
|
With what???? Again, you haven't said anything about the problem you're having.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
what am saying is that my local languages is not English. It is called Amharic it is in Ethiopia. I just wanted to develop simple word processing using this language. I started creating menu. But I couldn't. It is displayed as junk. If you can give some clue , please. And also any useful idea and/or sample project on how to create simple word processing using visual basic 6. Thanks in advance.
It is me.
|
|
|
|
|
I haven't used VB6 in about 6 years. It's a dead language, no longer supported by Microsoft.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Helo there. I just download the code which says developing simple word processor and try to run. But I couldn't. what should I do. Please help.
It is me.
|
|
|
|
|
Have you check the code? there are maybe some mistyped word or the code version are not same as your compiler. If it's a vb 6.0 code and you use vb2005 you can upgrade the code using upgrade tool.
|
|
|
|
|
With your lack of a description of the problem, it's impossible to tell you whats wrong.
Go to where you downloaded the code from and see if there is a forum or some other means to contact whoever wrote the code.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Do you have a good and proffessenal sample code(s) of using Treeview control in vb.net?
Best regards
Mansour
|
|
|
|
|
Sir/Madam,
I am facing the date query problem .Actually , I am using the following query to get the records which are present in between two dates.
select * from table where field between 12/12/2000 and 10/1/2001
* Field is the date type in the database.
Please help.
Thanks and Regards
Pankaj
|
|
|
|