Jump to content
Xtreme .Net Talk

Cags

Avatar/Signature
  • Posts

    699
  • Joined

  • Last visited

Everything posted by Cags

  1. Yes, and no. It is possible to achieve an effect similar to the one you describe, however you can't do it by putting a form in a panel. You can put forms inside a main form by creating an MDI application, but it will require some alterations to what you have already done.
  2. I have a folder structure for my application as follows... MainAppFolder (folder) - Global.dll - Application.exe - Plugins (folder) - Plugin1.dll - Plugin2.dll The Global.dll file contains the Interface declarations which are used by both the Plugins and the Application. By default that structure won't function properly as the Plugins require access to the Global.dll. To get around this I have added an item to the Reference Path list of the Plugin dlls, however I'm concerned that this won't function properly when the application is deployed. Can anyone tell me if this will still work after deployment, or if it won't work, suggest a better way of achieving the same effect. I know I could put the dll in the system folder but I'm trying to avoid that.
  3. My bad, I didn't realise that as I'm used to using int's.
  4. I think your missing the point of what people are suggesting (or maybe I am). If your application works when you open it new, then whatever code you are using to populate the DataGridView in the firstplace can be used to refresh the info. Simply clear all the information then use the same lines of code as your app uses on load to re-populate it.
  5. You will have to check if the value they input is valid in either one of the Key events, or in one of the Validation events. If you are using the 2.0 framework this can be done using the double.TryParse() method. If you are using the 1.0/1.1 framework you will have to use double.Parse() and catch the exception. Alternatively if you change one of the key events of the textbox you can allow only the number keys.
  6. Visual Studio 2005 doesn't work the same as Visuals Studio 2003, all the different languages were split into seperate installs (as was ASP.Net web development). It sounds to me like you have the wrong package. I could be wrong off course, I haven't got round to installing 2005 yet.
  7. What do you mean by 'format the lines to appear to have columns'? The ListView control supports columns.
  8. KeyChar is only available in the KeyPress event not the KeyUp or KeyDown events. To check if key char is enter then you can do... if(e.KeyChar == (char)Keys.Enter) { } For any more help you'll have to answer PlausiblyDamps questions.
  9. Well using the Graphics object you can use the DrawImage() method, this has overrides for using part of a bitmap image, as well as for using a colour key range for transparency.
  10. Beaten to the punch, what he said ^.
  11. Well at first I was convinced there was something wrong elsewhere in your code, as from what you've posted I couldn't see an error, but then I gave it a quick test. If you call GetRandomColor() from a button click and then click the button repeatedly, it always returns a different colour. However when called from a loop it returns the same colour for a set amount of time. If you had more items in your loop you would have discovered that after a certain amount the colour changes. Assumably this is down to the way random generates a number. I remember back in the days of VB 6 you needed to pass a seed to avoid always getting the same value. To counter this many people passed a tickcount. Perhaps in .Net this is automatically done. Calling the method repeatedly over such a period of time however would mean the tickcount stays the same for several iterations of the call. I'm sorry, this doesn't solve your problem, but hopefully shines some light on why its happenign.
  12. You can create a strongly typed collection class (for storing the subclasses) with an add method. Then create a property of that class in the main class. // pseudo code public class Team { public PlayerCollection Players { get { return _players; } set { _players = value; } } } public class Player { } public class PlayerCollection : CollectionBase { public void Add(Player obj) { } }
  13. Just out of interest what is the method for. I've not seen anyone use blt methods since I programmed VB 6. Surely the same effect could be achieved using the Graphics object? or have I missed the point somewhere?
  14. Thats probably because you consider a class equal due to its values wheras by default .Net will check if the two classes reference the same block in memory. I believe the answer is to overide the Equals method of your class. Then use class1.Equals(class2) instead of class1 == class2.
  15. Well done, you spotted my deliberate mistake, *Ahem*. I was going to ask you how you wished to handle ties, as that does complicated things abit. The solution I suggested works like golf so that if three people are on -10 then they are tied for first and the person on -9 comes fourth. By the sounds of it you want a table that works like Football (soccer for all you americans). So that there can only be one person in each position. Now assuming the metaphor you used of teams is the one being used by your application I'm assuming you have other properties of a team rather than thier score. If this is the case then I would have thought the best way to proceed would be to have a 'Team' Class which has a 'Score' Property. You could then create an array of classes and simply sort by that Property.
  16. Cags

    Msdn Tv

    Thanks, I'll give that a look (haven't got 44 spare mins to learn right now :)) on a side note, did you only just become an adminstrator, I'm sure your name was green not so long ago.
  17. Good point, personally never used that method as I didn't realise you could do that.
  18. Cags

    Msdn Tv

    I was just randomly browsing the net (as I spend most my time doing) and found a link to MSDN TV, something that I had previously never heard of. I was just wondering if anyone else had watched any of the episodes, if so what did you think to them?
  19. Something like the following should work, but note its untested. Just as clarification what this code 'should' do is for each total in the array, it should loop through all the other values in the array checking if they are lower than or equal to it, if it is this should lower the rank by one. int nTotal = 0; int nNextTotal = 0; int sMaxRank = nPlayersCount; int sCurrentRank = 0; for (int i = 0; i <= nPlayersCount; i++) { int curTotal = naTotals[i]; int curRank = nPlayersCount; for(int j = 0; j <= nPlayersCount; j++) { if(i != j) { if(curTotal >= naTotals[j]) { curRank-= 1; } } } naRanking[i] = curTotal; } On a side note, writing an algorithm to sort the array would be very easy if you store the values in an arraylist. I guess that would probably be a slightly neater way to go.
  20. You could simply amend the new char to the end of a string for example Dim sNewString as String = "" While iOldIndx < iFileLength If (sBuffer.Chars(iOldIndx) <> """") Then 'keep this character by copying to the new buffer sNewString += sBuffer.Chars(iOldIndx) End If iOldIndx += 1 End While however if your buffer is over a few chars long (which i'm assuming it will always be), then you should do as you say and use the string builder.
  21. Hehe, its always something simple when your sure its complicated :)
  22. Might be a stupid question but the class you are trying to call is definately public isn't it?
  23. I have no other suggestions, other than to make yourself 100% sure that all copies of the old dll have been deleted. I once had a problem where an old version of the dll was being copied local from an old instance of the project that I had completely forgotten was there.
  24. I have personally found with my Visual Studio that it is necessary to not only replace the dll, but to remove and re-add the reference for any additional changes to be spotted. I'm not sure if it's designed to be like that or just a bug, but hopefully removing the reference and re-adding it should solve your problem.
×
×
  • Create New...