|
what is the difference between datagrid where there is a * sign in the left corner and the datagrid where there is 'ARROW' sign in the left corner of datagrid
i'm using VB6.0
|
|
|
|
|
Hi guys,
i want to make MST setup for installing Visual studio 2005 as we do it for offices product through office 2003 resorces kit, It will transfor the setup file to mst and we can install the offices product by clicking on the batch file. I want to make such setup for visual studio 2005, which will help in installing Visual studio 2005 without asking next next finish stuff. its little urgent.
Thanks in advance
|
|
|
|
|
I want to create a mulitiple databases dynamically by using vb.net?
is it possible?
want to be best student for ever.
|
|
|
|
|
go to SQL Server. Generate the script of Database creation.
then use that script in vb.Net application . open the Connection with SQL server using Master Database. and run the database creation setup only. after running the creation command .. open the connection with Newly created DB and execute table,views,etc queries in it.
Rizwan Bashir
|
|
|
|
|
you can Use this query to create db in MS-SQL.
Create database databasename
|
|
|
|
|
Hi
i have a dll project in vb. The problem is that project not created binary file for the forms.In vb project every form has one form file and one binary file but it create only form filr.
So please tell me how i overcome from this probkem.
Thanks
|
|
|
|
|
Hi1, IM A Newbie!
gudday!
How to make Treeview using trough code!
i just want to make Treenode which have a subnode and the subnode have also a subnode!
i hope u can give me a sample code!
thanks! i hope u can help me!
coder
|
|
|
|
|
Open VS.NET and add some nodes using the designer.
Then open your code and you will se how nodes are added to the treeview.
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
where do i find vs.net?
coder
|
|
|
|
|
VS.NET == Visual Studio.NET
what development enviorment are you using or are you writing code by hand?
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I have a vb.net windows application that uses an xml feed from a website. I recieve an error message whenever I try to run the app at work because we are behind a proxy, how do I bypass it. I can do it easily in my asp.net application by adding code to the web.config but how do it for a windows application?
Thanks for any help...
Da Intern
|
|
|
|
|
I would like to dynamically insert information into an existing text document. The goal is to create a fax cover page template (in Word?) and replace certain keywords such as the recipient, subject, fax #, and message with information from a database. I would imaging I could use something like Crystal reports (although I do not have any experience with this product). Does anyone have any other ideas or can you point me to areas that I can research to accomplish this goal.
Thank you
Digicd1
|
|
|
|
|
|
is there any method that make me abale to hide a column in a listView without removing the column.
thanks,
|
|
|
|
|
set the column width to 0
|
|
|
|
|
thanks for replying:
it's the first idea that i do it but , it remain existed in listview and the user can resize it , son it will appear again ,
I have tried to catch the listview resize event to set the column width to 0 again but it doesn't works. (There will be a recursive call)
-- modified at 5:52 Wednesday 10th May, 2006
|
|
|
|
|
make th ewidth of the column 0(Zero)
Thanks
|
|
|
|
|
it's the first idea that i do it but , it remain existed in listview and the user can resize it , son it will appear again ,
I have tried to catch the listview resize event to set the column width to 0 again but it doesn't works. (There will be a recursive call)
|
|
|
|
|
it doesn't have to be recursive:
if the size of the column is not 0, then resize the column
if the size of the column is 0, then exit the function
Jason
|
|
|
|
|
how can we add a icon to a subitem in the listwiew
with VB6 we can add icon to the subitems :
Function Add([Index], [Key], [Text], [Icon], [SmallIcon]) As ListItem
ListItem.ListSubItems Add([Index], [Key], [Text], [ReportIcon], [ToolTipText]) As ListSubItem
how can we replace the features of this method ??
Braham Mounir
-- modified at 6:06 Wednesday 10th May, 2006
|
|
|
|
|
Hello,
I was wondering if anyone has any ideas on how to prevent an "Change" event to be raised two or more times when monitoring a directory for file changes? I have a application that writes log information to a logfile when ever a file changes. The logfile can be hard to read when their is multiple entries of the same change.
Thank you,
|
|
|
|
|
In my application, I watch a folder for any newly created files. If a file "pops" up in the directory, any data in that file gets parsed to a database automatically. Files "pop" up in the directory from other applications using StreamWriters.
I don't really understand the FileSystemWatcher class well, but I could get my code to "trigger" only once by simply adding handlers for only the .Changed event of the watcher (and not the .Created, .Deleted, .Renamed, etc events).
For my watcher (mw), I would set the .NotifyFilter property and enable events:
mw.NotifyFilter=NotifyFilters.Attributes Or NotifyFilters.LastWrite
mw.EnableRaisingEvents
and use only a single handler:
AddHandler mw.Changed, AddressOf FolderChanged
When files show up in the watched directory, the FolderChanged subroutine triggers only once, gets the newly added file, and parses the contents to a database.
This seems to work well if the files are created as Streams from other applications. It doesn't work though, if I manually drag/drop a file into the watched directory,..this seems to create two "changed" events which results in the FolderChanged subroutine being called twice resulting in two records being created in the db.
But then,..my app doesn't require manual drag/drops,..so for me, it does the job.
So, to make a long winded story short,..I could get the .change event of the watcher to trigger once when I used only a single handler in my particular app. Don't add any additional handlers. Probably obvious to most....so this may not help you.
I'm gonna watch this post as I too am interested in being able to better define what events in a directory can trigger the FileSystemWatcher object. I don't understand this bitwise "ORing" process doesn't seem to have enough options for fine-tuning events.
Good Luck
Dave
|
|
|
|
|
DSAlbin,
Thank you for responding to my question.
I find tuned my System.IO.FileSystemWatcher code to only watch for changes. I notice I had to set my notifyfilter to NotifyFilters.LastAccess instead of NotifyFilters.Attributes. The watch responded with only two entries in a random order (could be ten passes before the watch responds twice or the watch could respond with two entries one after another), otherwise it responded once like you said. I can live with this, but you are right the FileSystemWatcher is hard to control and I too still do not fully understand it.
I still can not find a VB.NET author that fully explains the System.IO.FileSystemWatcher class.
Again, thank you for your response.
Dave
|
|
|
|
|
Hi Dave (that's my name too )
I found a nice program at this link: "http://abstractvb.com/code.asp?A=1081" by someone named Jayesh Jain where I thought his coding technique was useful.
I agree very much with you that the FSW class is not very well documented, particularly in how various combinations of "OR" statements can be expected to behave when messing around with files.
In Jain's code, he uses a combination of "ORing" the .DirectoryName, .Filename, and finally the .Attributes enumerators to define his .NotifyFilter property, e.g.:
mw.NotifyFilter = NotifyFilters.DirectoryName
mw.NotifyFilter = mw.NotifyFilter Or NotifyFilters.FileName
mw.NotifyFilter = mw.NotifyFilter Or NotifyFilters.Attributes
(where mw is an instance of FileSystemWatcher)
he then defines the following handlers:
AddHandler mw.Changed, AddressOf logchange
AddHandler mw.Created, AddressOf logchange
AddHandler mw.Deleted, AddressOf logchange
AddHandler mw.Renamed, AddressOf logrename
and then the following routines (the .Renamed event passes a different signature and thus needs it's own subroutine):
Private Sub logchange(ByVal source As Object, ByVal e As _
System.IO.FileSystemEventArgs)
If e.ChangeType = IO.WatcherChangeTypes.Changed Then
txt_folderactivity.Text &= "File " & e.Name & _
" has been changed" & vbCrLf
End If
If e.ChangeType = IO.WatcherChangeTypes.Created Then
txt_folderactivity.Text &= "File " & e.Name & _
" has been created" & vbCrLf
End If
If e.ChangeType = IO.WatcherChangeTypes.Deleted Then
txt_folderactivity.Text &= "File " & e.Name & _
" has been deleted" & vbCrLf
End If
End Sub
Public Sub logrename(ByVal source As Object, ByVal e As System.IO.RenamedEventArgs)
txt_folderactivity.Text &= "File" & e.OldName & " has been renamed to " & e.Name & vbCrLf
End Sub
I played with this a little, and came up with this logic table:
1) Files streamed into a folder will trigger both the .changed and .created events
2) Files streamed over an already existing files will trigger (2) .changed events
3) Files that are deleted will trigger only the .deleted event
4) Files that have their names changed will trigger both the .renamed and .changed events
5) Files that are dragged/droped into the folder will trigger both a .created and .changed event
6) Files that are created within the folder by right-clicking-->Add new, will trigger only the .created event
7) Files that exist within the directory and are dragged out of it will trigger a .deleted event
8) Opening, editing, and saving changes to a file will trigger (2) .changed events
As you can see, many of these actions will only trigger the .changed event once (1, 4, and 5),...so if place your "log to file" code in the "e.ChangeType = IO.WatcherChangeTypes.Changed" If-then statement above, you should only get (1) entry.
Anyway, that's how I use this class,..just play with it until the actions you expect only cause a single .change event to trigger,..
oh well,...not as "clean" an approach as i'd prefer,.but hopefully it'll work for you!!
-Dave
Dave
|
|
|
|
|
Dave,
Thanks for getting back with me. Much appreciated.
Anyway. I must of read an article similar to Jayesh Jain on another interent site before because I had been also playing with simialar example.
Anyway, Jain code works the sameway with the "Change Events" you are correct about limiting the number of "Notifyfilters" to use. I disagree on how Jain uses the following example set for the filter.
wf.NotifyFilter = wf.NotifyFilter Or IO.NotifyFilters.FileName
wf.NotifyFilter = wf.NotifyFilter Or IO.NotifyFilters.Attributes
These statements cause the "FileSystemWatcher" to change more then once for a single change on the file.
Instead use this ....
wf.NotifyFilter = IO.NotifyFilters.FileName
wf.NotifyFilter = IO.NotifyFilters.Attributes
Also, the programmer needs to decide what kind of event to watch for ie. "Change" or "Created". I would not use both for the same "FileSystemWatcher" class.
I used the "wf.NotifyFilter = IO.NotifyFilters.LastAccess" instead of Jain's example because it still detect the events without the "change" events occuring mupliple times.
Keep intouch and I will continue to look for your comments.
Below is what I had came up with...
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
wf = New System.IO.FileSystemWatcher
On Error Resume Next
wf.Path = Me.txtWatchPath.Text
wf.Filter = Me.txtBoxFilter.Text
wf.NotifyFilter = IO.NotifyFilters.LastAccess Or IO.NotifyFilters.FileName
' add the handler to each event
AddHandler wf.Changed, AddressOf logChange
' add the rename handler as the signature is different
AddHandler wf.Renamed, AddressOf logRename
AddHandler wf.Error, AddressOf errorlogChange
On Error Resume Next
If Me.chkWatchsubDirecties.Checked = True Then
wf.IncludeSubdirectories = True
Else
wf.IncludeSubdirectories = False
End If
wf.EnableRaisingEvents = True
Me.btnStart.Enabled = False
Me.btnStop.Enabled = True
Me.txtBoxFilter.ReadOnly = True
' Turn off the update of the display on the click of the control.
Me.chkWatchsubDirecties.AutoCheck = False
End Sub
Private Sub errorlogChange(ByVal source As Object, ByVal e As ErrorEventArgs)
Dim sMessages As String
' Show that an error has been detected.
If TypeOf e.GetException Is InternalBufferOverflowException Then
Me.txtFolderActivity.Text &= ( _
"The file system watcher experienced an internal buffer overflow: " _
+ e.GetException.Message)
End If
End Sub
Private Sub logChange(ByVal source As Object, ByVal e As System.IO.FileSystemEventArgs)
If e.ChangeType = IO.WatcherChangeTypes.Changed Then
' Specify what is done when a file is changed, created, or deleted.
Me.txtFolderActivity.Text &= "File name is: " + e.FullPath & " has been changed" & _
" @" & TimeString & ControlChars.NewLine
End If
'If e.ChangeType = WatcherChangeTypes.Created Then
' Me.txtFolderActivity.Text &= "File name is: " + e.FullPath & " has been created" & ControlChars.NewLine
'End If
'If e.ChangeType = WatcherChangeTypes.Deleted Then
' Me.txtFolderActivity.Text &= "File name is: " + e.FullPath & " has been deleted" & ControlChars.NewLine
'End If
End Sub
Private Sub logRename(ByVal source As Object, ByVal e As System.IO.RenamedEventArgs)
Me.txtFolderActivity.Text &= ("File: " & e.OldName & " has been renamed to: " & e.Name & " " & ControlChars.NewLine)
End Sub
Dave
|
|
|
|