Well you must understand some of it, so, what exactly dont you get?
Well you must understand some of it, so, what exactly dont you get?
Well..
In your code you show the img object created, and loading a picture, once loaded obviously it remains in memory and technically wont need to be on the disk.. however, to replace the image, you dont need a new img object, just to change the picture in it.
As for the deleting of files, rather than have some background app that gets overly complex, create an object which holds a stringlist, which inherits from the disposable range, and then in the dispose have it remove the items in your list.
The image itself isnt but the object doesnt have to be new.
Then dont delete it, reuse it.
Well calcpoints would need to be in the base class, then it should be accessible
You didnt bother to post the actual problem with it, you just said it didnt work, no one can help unless you say what "didnt work" what did happen.. what code you had..
He had though that was the point :)
This would defeat the whole point of having data sources and is rather like forcing a square thing in a round hole.
However, as it seems someones unwilling to work with the dataset he setup, I guess theres little choice.
Shouldnt you really have a class basis for your warrior, wizard etc so you dont have to redo half the same code? (that way you would have stuff you could override)
CalcPoints is a routine under your app not under a class, so you wont be able to override it
PS please use code tags next time it makes it easier to read
Threading is incredibly simple, as sarehu says, msdn and your helpfile have some good examples
Only other way I can think of (and its 1am so that doesnt mean much) is to have a kinda parent/child relationship so that the server has a notify_icon option and the notify_icon has a server option.. but thats more messy than you need and the other suggesitons so far are the better way
Then why not pass srvr to the Notify_icon ?
OK, but perhaps your current way is why its not working - the example is very similar to what you wanted, in fact its where I grew mine from, so it does work. If you dont understand it, post the exact bits you dont understand and what you thought it should do as otherwise its going to be impossible to move you on from this.
Did you try following the MS example I linked? Which had a working list of a "class" that updated? (worry about the image part separately but basiclaly its just another part of the class)
In your "My Documents\Visual Studio xxxx\Projects" directory you'll find a directory which was the name you made when you saved it at school. Copy that directory onto your floppy/usb stick/cd etc and then place it in a similar location on your pc at home (eg if you had visual studio 2005 at school but downloaded 2008 at home - a) it will update and taking it back to school will be harder, b) the name will change from 2005 to 2008 .. then file open and find the project directory will be there, you can then go into it, and open the whatever .sln file you had made.
1. Array
2. You dont "convert"
3. yes
4. it updates the list, not the file, you still need to write that at the end
Thats why the image is in the class you were supposed to be making from the last post I did.. It will then populate the grid.
Normally you would create a class which included the picture, and then have a list of the class, but a picture wouldnt ever save in a csv file without potential issue so, if its just a icon to cover a given predetermind set of options (such as read, write, execute or such) then you could use enums and so on.
You should be able to make an image part of the row.. without any major issues.. Then it would update properly
Yep you can hide or remove them in VS but not disable them - kinda annoying really..
Delphi of course works a treat..
btw you guys doing the Embarcadero webinars this week and next?
You didnt read the link I posted then, as thats exactly what that does. You can use lists as data sources.
Then you need to change the keypress value to that of the return key, as well as montior for the length of input to be 4
There isnt an enable/disable function for tab pages. Only practical way is to use the onchange event and put back the focus where it came from
You dont, or rather you shouldnt need to it should all be done for you..
See http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifypropertychanged.aspx
I had this working fairly quickly when I tried it, I dont have the machine to hand I did it on, but I took a csv file and chucked it into a list of array of string and then added it.
As for your other post - which one?
If you split your data into a list of array of string, you can do a bit of googling and find how to use a list as a data source, then when they finish, just tab join the data back and write it out.
Put backslashes in front of any character and it will be treated as a litteral, so
\" will be a ", but it wont do anything odd with it.
Be aware in your code if you did apply the clip you wouldnt be able to press the button.
The clip code can be found at http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.clip.aspx
Its position can be set with http://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.position.aspx
most of the MS online help for commands has examples
Well they give your X and Y co-ords, do what you want to do with them..
Sorry if the following seems a little offensive, but thats verging on very lazy.
The mousemove event has 2 parameters (object sender, MouseEventArgs e)
e.X and e.Y return the mouses location over the item for which that event fired, eg, if you do it over a picture box it tells you where within the picturebox you are.. This should help
have you considered using the openfile dialog?
When you showed it before with a path in, your code hadnt told the stirng to be literal so c:\setstation.cmd would have turned to c:setstation.cmd, just as c:\test\setstation.cmd would turn to c:testsetstation.cmd
its probably upset because you put cmd.exe as your arguement, it might be trying to do something with it.
It will be running the batch file as if it runs from your current directory, this could also give you your file not found if its looking for something in the directory you ran it from.
possibly because you have the arguements and the filename round the wrong way? c:\windows\system32\command.com would be the filename, the batchfile is the argument.. as is the /c
Your code also doesnt have the @ so if you wrote c:\test\myfile.cmd it wouldnt have found it either..
If c:\setstation.cmd doesnt work, then you may need c:\windows\system32\command.com /c c:\setstation.cmd as your full command, rather than pass it as 1 command you would probably need to call c:\windows\system32\command.com with the parameters of /c c:\setstation.cmd
You should be getting some error codes saying why it failed.
double click on the form, it will give you the forms onload procedure, you can fill it in there.
getCompanyName(); //populates the Cbox with the data - it works
getCompanyID(); //returns the uniqueID for the selected item - doesnt work
I wouldnt expect getCompanyID() to work, you havent selected an item after clearing the box and repopulating it.
I must be being thick.
You get the item selected from a list box with
listBox1.SelectedItem
A dictionary is exactly that, it allows you to lookups on things.
If your listbox holds the string of the name then you would need a dictionary to pull out the relevant item against that name, or, if you create an object whos "tostring" returns the name you could just add the whole object to the listbox, knowing it will display the right thing, but then its the selected item, with no looking up required.
Holding things in an invisible text box would seem an odd way to do it, surely you just want a private or public variable for the form class?
Make sure you put the full path to the batch file. You may also need to call it as
command /c setstation.cmd
foreach ( string fileName in filesOnServer ){ string fileWpath = fileName; string fileOnly = Path.GetFileNameWithoutExtension(fileName); int index = filesOnServer.IndexOf(fileOnly) ; if (index >= 0) { if (!filesInDatabase.Contains(fileOnly) ){ foreach ( string fileName in filesOnServer ){ string fileWpath = fileName; string fileOnly = Path.GetFileNameWithoutExtension(fileName); int index = filesOnServer.IndexOf(fileOnly) ; if (index >= 0) { if (!filesInDatabase.Contains(fileOnly) ){
and index is 0 until it hits the !filesInDatabase line then it becomes -1. So that explains why it is -1 thanks.
OK here you look at files on the server and find they arent in the db, so you need to add them, this is cool.
any idea how to check then to see them if the file isn't in the database?
Sure, now do the same tests but with the db and server roles reversed so get the filenames in the db and check if they are on the server or not. If not perhaps you need to delete the entry in db or resave the file to the server.. depending on your need.
secondary - why doesn't index change to -1 when it gets to
if ( !File.Exists(SOIDs[index]) ){
because thats a test, not a value setting.
before you had the code
int index = filesOnServer.IndexOf(fileOnly) ;
where you set index, if you dont set that to something else it wont change :)
Then we need more of the code, because you only show up to the start of the decision making process.. If the file was not found then yes the index will be -1 because its not on the list.. whats the actual error you get?
Um, first thing that comes to my mind is that you define SOID as List<String> but.. you then refer to SOIDs... whats SOIDs ?