Jump to content
Xtreme .Net Talk

sjn78

Avatar/Signature
  • Posts

    258
  • Joined

  • Last visited

Everything posted by sjn78

  1. You could just do a printsceen and them touch them up. This method won't be any good if you want to make your icons bigger than the originals though.
  2. sjn78

    C# questions

    You don't have modules in C#. You can create a class to store variables though.
  3. Show is what you use essentially to confirm and place your control. Dim c as New control() form1.controls.add© 'puts it on the form c.Show() ' now shows it ------------ Dim c as New control() form1.controls.add© 'puts it on the form c.visible = false 'makes it invisible c.Show() ' now shows it, but its invisible ------------ Dim c as New control() form1.controls.add© 'puts it on the form c.visible = true 'makes it visible but since there is no show, nothing will appear
  4. Yeh thanks. I figured it out a while ago, but didnt get back to posting. Pretty obvious mistake, declaring it as a Form, so the label wasn't there, but declaring it as frmSplash and the label shows!! Thanks anyway
  5. I won't be telling him nothing!! I will just code the assingments to what I know and have learnt from MSDN or from reading the forums here. From the examples in the Uni Text's (written by the Uni) there are a couple of little tricks that I will be using from now on. I have had a couple of good lecturers from C and C++, they seem to know what they are doing, more so than this VB.Net guy. One lecturer I had was Ron House, you may of heard of him as he travels back and forward from here (Australia) and the US. And he had written a couple of good C/C++ texts. He comes across as a little arrogant and I don't think he has much time for people who won't or don't want to learn, which is good as you weed out the people who are just doing a subject just for a credit point. Those lecturers are good, straight to the point with the correct methods and its up to you to find out why you are doing something in a particular way.
  6. Im trying to do a similar thing, but the above won't work for me. I have frmMain & frmSplash On frmSplash there is a lblLoading label In frmMain I have a loading routine that loads the interface and sets up the menus while the splash screen is being shown. void startup() { Form fSplash = new frmSplash(); fSplash.Show(); fSplash.BringToFront(); Application.DoEvents(); if (connectionGood() == false) { MessageBox.Show("Database not present"); } causeWait(); // Causes a short delay fSplash.Dispose(); } I want to use the label on the splash form as a progress indicator showing what it is loading etc. Now in vb, you could just say fSplash.lblLoading.Text = Whatever and I find in C#, this is not available. I have tried setting the label to public and I still can't access it. So, how to do this?? Thanks
  7. You can write the assignments in C# though!!. Although they said they have no means to support that language. And the point I was trying to make was that the course is a basic one for GUI design and to also give people some exposure to .Net. But again, why teach bad habits if these people have had no experience before (maybe vb6 or earlier). Isn't this type of course a perfect example to teach the proper ways before you pick up bad habits? I know I still have plenty of bad habits in programming from looking at various websites that show you ways around problems and from trial and error.
  8. I am doing a GUI subject for uni at the moment and they say to use VB.Net. This is irrelevant but what they are teaching amazes me. The methods they are teaching to do basic things are the 'Bad' way so to speak. For instance, MsgBox("blah"), wouldn't you want to teach someone to use MessageBox.Show() for the fact that it is used both in vb and C# and that MsgBox is the old way? Another example is trying to tell us to use a keypress event and watch for Enter. e.KeyChar = Microsoft.VisualBasic.ChrW(13) Wouldn't you use e.KeyChar = Keys.Enter Anyway, be interesting to see how they mark me if I don't do it their way and actually do it the correct way!!
  9. My guess is youwould need a list (text file) of words. They are around, just have to find them. I had one for uni a while ago. Then just search each word for matching letters. You might want to read in the text file first of all and then split it up into arrays for different size words. words2() '2 letter words words3() '3 letter words words4() '4 letter words Doing this may speed up matching words when you want to unscramble them. But then again, it may slow your app down when you load it because you have to split the master list up into the various arrays.
  10. Was working away and everything was going fine...added a couple of checkboxes and went to compile it and I got this error. The file 'addbook.dll' cannot be copied to the run directory. The process cannot access the file because it is being used by another process. Could not copy temporary files to the output directory. addbook.dll is just one project in my solution I have made. Its not the base project or anything. So..what did I press accidently to stuff this up? Have restarted my pc since it said it was being used by another process but it made no difference. Strange thing is that it was compiling ok beforehand. *Edit...now I'm confused...it will compile using Release mode but not Debug **Another Edit - got it working again. I had the output for the projects going to 1 folder. Set them back to where they default to and it works. Strange though because they were all building to 1 folder before this happened.
  11. x = (form.width / 2) - (e.Graphics.MeasureString("yourstring", f).Width / 2) f is your font. y you will have to do something similar (form.height / 2) - 10 or something to allow for your font height. Just play with the '10' to make it suit.
  12. For a splash screen, or any form in that matter, you can override the paint event. Make sure you imports system.drawing & system.drawing.drawing2d. I am typing this from memory, but its something like this. In the on_paint overrides, dim f as new font("Arial") e.graphics.drawstring("Your text", f, x, y) Same goes for you image. Create an image dim img as image img.fromfile("yourimage") e.graphics.drawimage(img, x, y, width, height) Put the drawimage before your drawstring otherwise the image will be drawn overtop of your text. You will have to check your images size and resize it according to the size you want your splash screen. Just have a look into the e.graphics.... and you will find plenty in there to manually draw items onto your form.
  13. Use GDI and draw the text directly onto the form? Although doing this you may have to draw the image directly onto the form as well.
  14. I tried that port first of all without any luck. Maybe its my router settings. You can let one computer have direct access to the internet by specifying the ip address so that the inbuilt firewall won't stop any traffic. Tried this as well without any luck. Funny thing is that Norton keeps picking up 'Attacks' from other computers thoughout the day from computers I have no idea of whose they are. I will keep playing around with. Must be a setting a haven't seen yet.
  15. So, I finally did it...went from access to msde. The speed increase on retrieving and inserting data is huge. Found that the time it takes to pull back 1000 records from msde is the same as it takes to even open an access connection and pull back 1. One question though, is it possible to do this... Have installed the msde database on my pc. It is networked with 2 other pcs using a router and have the internet connection plug into the router also. I have managed to get the other pc's reading the database, but can someone outside the network, eg you, gain access to the database? I have tried setting up norton to allow connections to the database on the appropriate socket and same with the router, but its still not going. My connection string has the IP address of my PC to give it a direct path to the database. I know this should be possible, but where would be the best place to start looking on doing this type of setup. Thanks
  16. MP3's that get mostly played on my machine Audioslave Muse Rammstein The Tea Party Rage Against The Machine Still converting my cd's over...Got 200gig to to fill up, so what better way than MP3's!! So far have about 2000 on here and thats about 1/4 of the cds I have.
  17. I work in GIS as well....we use MapInfo. Work for local council and we maintain all the infrastructure citywide. We are actually looking to use Sql Server as the backend for the GIS data, only problem is Sql doesn't hold the mapped object. Oracle did though, but its too expensive to go council wide (1000+ seats). You can have my job Joe Mamma!! I want to get out of it to be honest. 6 yrs of mapping sewerage mains is giving me the sh*ts!! Might be moving to Arc in the near future as the next version of MapInfo goes to .NET and our IT people can't handle that problem or maybe they don't want to.
  18. Nice links. Although I didn't doubt what you had said, for the purpose of what I was doing, it was overkill. But I will look into this a lot deeper when the need arises.
  19. sql = "SELECT * FROM Contacts WHERE " + @"FirstName = """ + e.Node.Text.Substring(0, e.Node.Text.IndexOf(" ")) + @""" AND " + @"LastName = """ + e.Node.Text.Substring(e.Node.Text.IndexOf(" ") + 1) + @""""; Dont need parameters.....although I did look into them. I put in odd characters into the records and it works fine.
  20. I used to just make my query like this: sql= "SELECT * FROM Contacts WHERE FirstName = '" & txtFirstName.Text & "'" unitl I discovered that is the persons name had a ' in it, it didnt work. I then changed it to sql= "SELECT * FROM Contacts WHERE FirstName = """ & txtFirstName.Text & """ and that works.....for VB anyway. How do I get this to work in C#? The first one works with the = '", but how do I use " in the string. Im using an Access database by the way.
  21. See if you can open any files in notepad and then start you project again from scatch. Copy and paste!!! Thats what I had to do.
  22. sjn78

    C# equivilant

    When I was learning C and C++ in Uni, we used pointers to directly access an object or variable. Are they still used in that sense? Or is it different such as you use ref or pass the value to the sub?
  23. I have found a few .net forums and see this one as the better one of them all. I don't particullay like the ones where they give you stars or ratings and that stuff. It sort of takes away the purpose of helping others in good way and not just to get recognition. There are sometimes I feel reluctant to put up a post because I think its something so simple, I should be getting it worked out myself. But in general, I have learnt more from this site than all of the others combined. I do get annoyed at the posts who asked a question and then want someone else to code it for them, not so the small snippets but rather a largish function/sub that may take someone 30 or more minutes to perfect. Speed wise I don't have any hassles. I'm on cable and when it goes slower than normal, I just figure its the ISP having a lot of traffic at the time.
  24. In VB I had this Sub OpenForm(ByRef myForm as Form) Dim f As New Form() f = myForm f.show() End Sub Some other event would contain this OpenForm(New frmAddress()) How do I achieve this in C# Thanks
  25. Well, I believe that people choose the language that suits their own style and needs. But to criticise other languages because you don't personally like them is something people do I guess. For example, the majority of people would speak english right? Are you going to tell someone if they speak french, german or spanish that their language is not good enough because they don't speak english? Hell no, thats what they know best and use to communicate with. Programming is no different. You tell the machine to do something in the language you are comfortable with. If you can speak more than one language, good for you, it shows you have put in an effort to step outside your so called native language to expand your horizons. Going back to what I said in this post earlier about getting VS Pro today. I am going to have a look at some of my VB projects and convert them to C#, for the fun of it. So far all the differences I have found is the syntax in declaring variables/objects and the semicolon at the end of each line. I am sure there are more changes than that, but thats what experimenting and learning is all about.
×
×
  • Create New...