| Main > Software Forum |
| State of the FE devs? |
| << < (11/25) > >> |
| jelwell:
This is all in the wiki. Joseph Elwell. |
| headkaze:
--- Quote from: Howard_Casto on September 11, 2006, 09:19:26 am ---That isn't the same thing. With the old vs6 stuff you can do an array of controls, and put controls in an array. Now you can just put controls in an array. The first is very useful for click events. I can have an array of labels (label(0) to label(13)) and they share common events. So the same function can be called if any of them are clicked without any special code or for/case statements. I haven't figured out how you can do that in .net, I think it's impossible. --- End quote --- Of course you can do that in .NET! Just have a label array like in VB6 and add the same function to the click event of each label: --- Code: ---Label[] myLabels = new Label[13]; System.EventHandler labelEventHandler = new System.EventHandler(Label_Click); for(int i=0;i<13;i++) { myLabels[i].Name = "Label" + i.ToString(); myLabels[i].Click += labelEventHandler; } private void Label_Click(object sender, System.EventArgs e) { MessageBox.Show(((Label)sender).Name); // Display label name of clicked label } --- End code --- You can draw a control onto your form and in your form's code there is a box called "Windows Form Designer generated code" which is a region you can expand and see the code generated by the IDE. If your referring to rewriting Jonny5 using C# I wouldn't use form controls, I would use GDI+ (aka the System.Drawing namespace). .NET is very flexible, and I can assure you that anything you can do in VB6 can be done in .NET. I uploaded one of my VB.NET assignments for you a while ago to check out how to use GDI+ in .NET. You can still download it from here. It was the basis for the GameEx Theme Editor I wrote, but I must admit I now write in C#, but you can convert the two quite easily and the resulted binaries are practically exactly the same. Check out ConvertCSharp2VB and you can convert C# to VB.NET by pasting code into the website. I think there is a similar site somewhere that does the reverse. |
| Howard_Casto:
Manually adding the same function for each label and having it automatically done for you are not the same things. There are a ton of things you can't do in .net that you could do in vs6 automatically, the most notable one being controls with transparent backgrounds. Mind you, you can do it manually with gdi functions, but I don't understand how a platform that makes you do teh easiest of things the hard wasy is supposed to be better. Especially considering you've got that 20 megs of bulk that has to be installed for each program. Mind you that doesn't always apply to fe development as hopefully we aren't using standard controls for everything, but it seems like for simple "windowsy" apps .net is 2 steps forward and about 10 steps back. The main reason I'm not willing to upgrade yet is not because for my bg apps (dk j5) but my small ones. It'll increase the bloat and make normally simple apps a lengthy build. |
| JoyMonkey:
--- Quote from: screaming on September 03, 2006, 07:49:20 pm ---Oh right! I forgot about Kymea-- Kymar -- Kymaera.. At one point I tried getting everything together to compile it but I never managed to. Then, wasn't he working on a big update? --- End quote --- Yeah, the update was going to add support for PNG-24's with their beautiful alpha transparencies. With that in there, you could make some really slick looking skins. |
| headkaze:
Oh I think I get what you mean now, you mean when you use the IDE to draw a control like a label if you copy and paste it in VB6 it automatically places the control into an array for you. Yeah okay, I've never tried that in .NET but I'm writing an application as we speak that uses dynamic controls, and I just draw the control on the form, copy the generated code, then create a function like Label drawLabel(int x, int y, int width, int height) then I get it to return the Label object it creates and place that into a ListArray, so if I want to delete all the controls I can just loop through a foreach and object.Dispose(). But seriously, if your not taking on .NET because it doesn't create controls into arrays automatically, or that controls can't have transparent backgrounds then that's a pretty lame reason. For a start you shouldn't be using form controls for things like Johnny5. That should be done using GDI+. I think your coming up with anything to avoid the inevitable realisation that it's time to upgrade your coding skills. VB6 is dead, it's time to get over it and move on (IMHO) :P And that 20 Meg of bulk isn't memory resident bulk, it's all the namespaces, dlls etc. and when you consider the amount of automation and code they've put into it, 20 Meg is a reasonable expectation. I also expect Vista to have .NET Framework installed by default. I remember the VB6 runtimes were never in Windows by default either. And really where in the day and age of dual core processors and high speed ADSL2, so really we can't say that 20 Megs is a big download, or that it's slower than a C++ program. I know youki keeps saying .NET is only for fast machines, but it's not true. If you look at GameEx as an example there are many people who run it on slow machines. I tried the demo of AtomicFE and to me the scripted themes were very slow, so it's funny how people can call .NET slow just by an assumption. Well, I don't want to keep trying to convince you to move with the times, if your gonna keep coding in VB6 your gonna keep coding in VB6. Dosn't really bother me really. I know as a fellow coder your passionate about the language you use. But I used to love VB6 too, and it's not after you undertake a big project in .NET do you start falling for it like VB6. And once you go dot net you never go back... :) bah who cares! O_o |
| Navigation |
| Message Index |
| Next page |
| Previous page |