|
Hi there, is there a C# method that will allow me to search for all the files of a specific extension and then delete them? I know there is an Exists method, but what do I pass into the method? What I have available are the path to the files and its extension.
|
|
|
|
|
System.IO.Directory.Getfiles. I can't remember all the params but one is where to search, and what to search for. If you want to search for exe's you put "*.exe"
|
|
|
|
|
You can't delete using a pattern, you need to identify each file and delete it individually. Use the directoryinfo getfiles method with a pattern filter, loop and delete each file.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hi All,
I have to forms.
In my seconde form i have a button that updates the first form.
The problem is that when i click that button, the first form get updated , bud the second form desappears, then i have to click bring it back from the windows taskbar.
How can i prevent that? i want that the second form remains active.
Thanx.
|
|
|
|
|
try searching the site
"Update parent form" turned up this article which may be of use.
clickety[^]
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
How you are updating form1 from form2?
Alternatively, you can show the second form as a modal window.
|
|
|
|
|
Listen,
try creating userforms and load then on the main form (using delegates)
or create child/parent form method
You can check that out here in codeproject, i myself already checked it.
Give it a try.
Do you really need to use to forms??? for any important reason???
in child/parent forms you can also use as many forms as you wish.
Good Luck
nelsonpaixao@yahoo.com.br
|
|
|
|
|
Hello,
for my project I'm dealing with a table layout with a bunch of images. When I click one of these images (left-click, that's a requirement), I would like to pop up a control, basically a listbox with some choices. How should I best go about this? My - probably poor - choice so far is to display a form on top of the table layout form, that suits the purpose but seems not like the _right_ solution. Has anyone some inspiration for me, how I could pop some control up on a form surface which already has a layout to it?
Thanks for the inspiration,
Morten
|
|
|
|
|
harleydk wrote: choice so far is to display a form on top of the table layout form, that suits the purpose but seems not like the _right_ solution
It is about the only solution, that I know of, unless you want to create some kind of table class that pops the listbox up, and then you are still having to use a form control.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
When the user clicks, get the mouse cursor (I don't remember how), set the location of the listbox to the location of the cursor, and add it to the form and not the table.
|
|
|
|
|
As Jordanwb suggested but you can have an invisible control and just move it and make it visible when required (may be better than creating and disposing of the control repeatedly). Deciding when to make it invisible after the user is finished will be the issue I would think.
Mouse location is easy to trap on the click event.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
Hey Guys,
I have a datagridview that uses a DataTable as the data source: (dgv.DataSource = dataTable;)
The data loads into the dgv perfectly but it does not appear to be syncronized with the dataTable.
For instance, let's say I add a new row using the dgv. When I view the underlying DataTable, I don't see the new row added. This may be an easy question but I've scratched my head all day long trying to answer it. Once I can get the dgv's new rows to be added to the DataTable, I can update the table back to the database. Is there a function that I'm supposed to call from the dgv?
I've used up all my sick days, so today I'm calling in dead.
|
|
|
|
|
I think you should put a bindingsource between dgv and datatable.
|
|
|
|
|
Hi there.
I wanna do process that take a long time of cpu.
When I do that without Thread Not Responding occur.
But I don't know how can I do it by Thread.
Can you help me or refer me to an article ?
Thanks in advance.
|
|
|
|
|
If your doing this process from a UI, I suggest researching BackgroundWorkers. If your making a service, then check out the System.Threadding namespace.
|
|
|
|
|
Thank you Scott .
Can we access to Form's control by it (BackgroundWorkers)?
|
|
|
|
|
The background worker cannot directly access other controls not on it's own thread. What you can do is use the ReportProgress method along with the ProgressChanged event from the BackgroundWorker object. If your using a progress par, you can pass a percent value into ReportProgress(int) from the thread that the background worker is on, and update the value of your progress bar from the ProgressChanged event.
There are many articles online about this objects, so search those for syntax and structure ideas.
|
|
|
|
|
|
It seems that there is no way to get the LanguageID setting for an individual WorkBook (or WorkSheet) in Excel 2007. The only languageID in Excel is Application.LanguageSettings object, but this object is read-only. It can not be changed, and it is applied to whole application, not just for an individual Workbook (or WorkSheet). Even I open Excel to try to manually change language for the current workbook, but no way, because there is no button for setting language under the "Review" tab ribbon on the "Proofing" group.
Does Excel allow any user to set a specific language for each individual WorkBook (Or WorkSheet)? I know that the language can be set up from the "Office" menu under "/Excel Option/Popular", but that is for all Office App, not just for Excel (and of course, not just for each indivdual Workbook or workSheet).
Thanks a lot in advance.
|
|
|
|
|
I believe that (preferred) language is a global setting for Office.
However, if you want to check spelling, the CheckSpell-method has a parameter for language:
SpellLang
Type: System.Object
The language of the dictionary being used. Can be one of the MsoLanguageID values used by the LanguageID property
Keyobard layout then again can be controlled via Control Panel's keyboard manager
|
|
|
|
|
I want to use the "Insertion Point" to insert some specific symbol grabbed from a pop up form, but it seems that there is no way to get the "Insrtion Point" in Excel via VSTO Object Model. e.g. if for Word, I can use something like "Application.Selection" to get the "Insertion Point", and for PowerPoint, use something like "Application.ActiveWindow.Selection", but for Excel, the "Selection" object only represents a cell, a row, a column, or a selection of cells, etc. I can not get the selection object to represent something inside an individual cell.
I tried to use Application.SendKeys to simulate keyboard for this issue, but it does not work properly for unicode character. Any idea? Thanks in advance.
|
|
|
|
|
How to make a form to look like a form that is used in Internet Explorer 7/8, Google Chrome... ?
In particular, i think about the top distance, and placement of other controls (textboxes, labels, etc) on top.
|
|
|
|
|
Check out the free Telerik TabContainer. You get it when you register Visual Studio.
|
|
|
|
|
Any ideas of non WPF solutions?
|
|
|
|
|
http://blog.waltersys.de/komponenten/c-chrome-like-windows-forms-application/
|
|
|
|