|
Not sure about the FlexiGrid, but the ListView control allows you to modify the format of the subitems by setting ListViewItem.UseItemStyleForSubItems = False , then you just change the properties for a particular subitem to get the desired results.
There may be something similar for the FlexiGrid?
Hope this helps.
Tom
|
|
|
|
|
I dont know what type sample.violet is... what the CellForeColor expects is a long integer containing some RGB value. To set font color in cell(4,5), you will need to do something like:
flxgrd.row = 4
flxgrd.col = 5
flxgrd.cellforecolor = rgb(180, 180, 180)
hope this helps.
|
|
|
|
|
|
moomoooomoo wrote: im using this msflexgrid control on a vb.net 2005..
Why? Especially when .NET 2.0 comes with the DataGridView that is incomparibly more flexible than the old flexgrid.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Is there a way to get the time that the last event was fired by an application?
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
Not if you didn't store it when it happened, no.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
So what would be the best way to intercept events and keep track of when the last one was fired? I'm trying to make a login box that will come back up and lock the user out if there has been no activity in the application for a specified period of time...any ideas? Thanks for any help and thanks for the quick reply.
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
Take a look at the Application.Idle[^] event. It might be what you're looking for.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
Thanks this looks great, should work perfectly!
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
Sorry, I do have one question though, how will i know when the application is no longer idle?
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
There's no event for that one.
What you want to do isn't normally done in applications. It's left up to the system to lock itself.
You might want to look into overriding the WndProc of your startup form to get this. You dont need to look for a specific window message, just that there is one comming down the pipe.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
So, something along these lines:
Private mLastEventTime As DateTime = Nothing
Protected Overrides Sub WndProc(ByRef msg As System.Windows.Forms.Message)
MyBase.WndProc(msg)
mLastEventTime = DateTime.Now
End Sub
except I wonder if WndProc would be called during an idle event if it was not being handled elsewhere...do you think i would need to add an empty handler to the Application.Idle and override WndProc at the same time?
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
Do you think this would work if i used application.addfilter?
Public Class LoginTimer
Implements IMessageFilter
#Region " Delegates "
Public Delegate Sub IdleSub()
#End Region
#Region " Variables "
Private mCurrEmpTimeout As Integer
Private mLastMessage As DateTime = Nothing
Private WithEvents mBackgroundWorker As New BackgroundWorker
Private mSub As IdleSub = Nothing
#End Region
#Region " Constructor "
Public Sub New(ByVal theSub As IdleSub)
MyBase.New()
mBackgroundWorker = New BackgroundWorker
mSub = theSub
AddHandler mBackgroundWorker.DoWork, AddressOf mBackgroundWorker_DoWork
End Sub
#End Region
#Region " Event Handlers "
Private Sub mBackgroundWorker_DoWork(ByVal sender As Object, ByVal e As DoWorkEventArgs)
If Not mLastMessage = Nothing Then
If DateTime.Now.Subtract(mLastMessage).TotalSeconds >= mCurrEmpTimeout Then
mSub.Invoke()
mLastMessage = DateTime.Now
End If
End If
End Sub
#End Region
#Region " IMessageFilter "
Public Function PreFilterMessage(ByRef m As System.Windows.Forms.Message) As Boolean Implements System.Windows.Forms.IMessageFilter.PreFilterMessage
mLastMessage = DateTime.Now
End Function
#End Region
End Class
Apparently it's not OK to start a bonfire of Microsoft products in the aisles of CompUSA even though the Linuxrulz web site says so
|
|
|
|
|
Hi again!
My project is done and now I want to add icons to it.
I read that I can do this by selecting the *.ico file at the settings.
As I tried that, a error message poped up. The text was something like "32x32.ico is not a valid system file." I also tried a icon with 16x16 pixel with the same result.
I'm using Microsoft Visual Basic 2005 Express Edition if that has something to do with it.
I also added the file to the resources directory of the project.
Does anyone know how I can add Icons to the project?
|
|
|
|
|
I treid an other way to add the icon and a error warning popped up that said that this file cannot be used as an icon (but it is a *.ico file).
I use the freeware PixelToolbox 1.1 and create a 32x32 pixel windows icon with 4bit depth.
Do I use the wrong program, or wrong settings?
|
|
|
|
|
It could be that the app isn't outputing the correct file format. You might also want to try making 256 (8 bit depth) color icons, not 16.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
I "solved" the problem by using another icon creator.
Setting another colour depth had no effect.
Thx much
|
|
|
|
|
I know you already solved your problem, but I thought I would send you the link to an article I wrote on this subject. It is pretty basic using simple tools. It sounds like the icon create you have may be the better thing to use.
http://www.codeproject.com/useritems/HowToIcon.asp[^]
Ben
|
|
|
|
|
how can i sort array in vb
|
|
|
|
|
Easy way to answer Ur question:
For i=0 To N-1
For j=i+1 To N
if Array[i]< Array[j] , then Swap the elements Array[i] and Array[j]
Next j
Next i
N-> Index of Last element.
Regards,
Arun Kumar.A
|
|
|
|
|
Why rewrite what the framework already offers ?
This is a bubble sort, it's quite slow.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: This is a bubble sort, it's quite slow.
I think this is selection sort.
Bubble sort would be: (in C Language)
for(i=1;i<n;i++)
{
for(j=0;j<n-i;j++)
{
if(a[j]<a[j+1])
{
swap a[j] and a[j+1];
}
}
}
Christian Graus wrote: it's quite slow.
Yes, it is the slowest sort.QUICK sort will be the most quickest.
Regards,
Arun Kumar.A
|
|
|
|
|
Arun.Immanuel wrote: QUICK sort will be the most quickest.
I'm not sure, I think it just has the best marketing team :P
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
You can also take advantage of the sort method found in the Array class. Just pass your array to Array.Sort. The method is overloaded and can take a number of different parameters.
|
|
|
|
|
I have a vb.net 2005 form that calls up another form to add or edit a record in an Access 2003 DB. All that is on this add/edit form is labels and text boxes. I have a primary key and when I add a record it works just fine, but when I try to edit a record I get the following error....
"Update requires a valid UpdateCommand when passed DataRow collection with modified rows."
Here is the code that I am using, I have stepped through the code and everything seems to be functioning just fine right up until I get to the Update line below, that is where I get the error.
Me.Validate()
Me.SurgeonsBindingSource.EndEdit()
Me.SurgeonsTableAdapter.Update(Me.AnesDataSet.Surgeons)
Can anyone help me track this down? I am really at a loss. I bet it is something easy but I just can't seem to figure it out. Thanks for any help that you can give!
|
|
|
|