Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
N

nlowdon

@nlowdon
About
Posts
26
Topics
16
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Book/s
    N nlowdon

    Thanks folks, i'll look some of theses up !

    Abhijit Jana wrote:

    From next time while post, first search google

    Like i said Abhijit, i have already searched online bookstores, google etc -sometimes it better to ask people who have possibly been in the same situaton, or found a book that really 'worked' well. Don't worry - i wasn't asking anyone to do any of the work FOR me. Mearly asked for an opinion. Neil

    ASP.NET csharp learning asp-net

  • Book/s
    N nlowdon

    Morning all, My appologies in advance if i'm asking this in the wrong page - my train of thought was that most people in here would have a opinion. Anyway.....i've started learning c# at university and all is going well (so far !!) and i increasingly see ASP.NET mentioned alongside. Can anyone give me some advice as to a good book to pick up to start learning ASP.NET also. I'v looked on Amazon and places like that and there are plenty to choose from, i just don't want to buy a book that i won't understand because it's too advanced so though i'd ask those that might know - you guys ! If it helps anyone - i've used the O'Reilly 'Head First' range and found them very helpful in the past. Thanks in advance Neil

    ASP.NET csharp learning asp-net

  • Book/s ??
    N nlowdon

    Evening all, This is my first trip over here (to this part of the site anyway) so excuse me if i'm posting this in the wrong place ! Anyway, my question is, i have started studying c# at university and was wondering if anyone could reccomend a good book that i could buy to 'dip my toes in the water' of ASP.net. I have no previous programming experience but ths does seem to be a language that gets a lot of focus these days. Once again, my appologies if this is in te wrong place (not really a programming question - is it ?) Regards Neil P.S fantastic site

    The Lounge csharp question asp-net learning

  • TabControl events
    N nlowdon

    Hi Luc, Sorry - i know this is dragging on a bit. I have the tab control functional and populated with my controls already, what i want to do is make some other controls (check boxes etc) appear on the page when the user clicks on a tab. I can code an event if i double click on the page of the tab (in designer) but that doesn't help work. I want the event to run when the user clicks on the tab. It's not the same as clicking on the tab page. Hope this makes sense !

    C# database help tutorial question

  • TabControl events
    N nlowdon

    unfortunatley i'm completely new to programming so all that means very little to me. Its my first time trying a tabControl, i have created & tested all my buttons to go on it, i just needed other things to appear on the form when user chose the varius tabs on the form. I'm kind of thinking i've bitten off more than i can chew ? :confused: I'll have a look for infon on 'UserControls' and see what i can find. Many thanks Neil

    C# database help tutorial question

  • TabControl events
    N nlowdon

    Thank you Luc, So can you please give me some guidance as to how i would then use this to make some.....labels or checkboxes appear for instance ? I have trid a few things but it seems quit a dfficult control to use. Thanks Neil

    C# database help tutorial question

  • TabControl events
    N nlowdon

    Good evening all, I have a form with a number of controls on it. In particular - some buttons and a 'TabControl' In the form designer, when i double click on a button, i can code an event to fire, like below,

    private void button1_Click(object sender, EventArgs e)
    {
    //some code
    }

    I would like t be able to do the same when the user clicks on one of the tabs of my TabControl, however i can seem to find a way to trigger an event like i do with a button. For example - if i double cick on the tab in the designer view - nothing happens. Can anyone help ? Regards Neil

    C# database help tutorial question

  • List items [modified]
    N nlowdon

    Afternoon all, I'm trying to tidy up my code a little and wondered if its possible to add a number of object to a list on one line of code. i.e

    zooAnimals.Add(newcat1);
    zooAnimals.Add(newcat2);
    zooAnimals.Add(newtig1);
    zooAnimals.Add(newtig2);

    is there a way of putting these all in the one statement ? Something like,

    zooAnimals.Add(newcat1),(newcat2),(newtig1),(newtig2);

    (I know the above DOESN'T work, it's just there to readers an idea of what i mean) Thanks Neil

    modified on Thursday, December 11, 2008 8:57 AM

    C# question

  • object type [modified]
    N nlowdon

    Thanks Thomas, I'm new to interfaces so thats probably why i've left that way out just now (not too confident with them !). Regarding the first option you gave, i understand how that works, but still cant see how it will allow me to access the methods in the animals own class....say Cat class ? Can i cast the 'pettable' to instance of an object 'Cat' ?

    C# question

  • object type [modified]
    N nlowdon

    Hi, I am using an interface a stepping through a list for my application to perform a method. (listed below)

    foreach (IPetAnimalKeeper pettable in zooAnimals.OfType<IPetAnimalKeeper>())
    {
    pettable.pet();
    }

    Is there a way that i can then check the type of 'pettable' ? reason being i would then like to call another method but would need to know the type first. For instance if i wanted to call a 'move()' method.......i would need to know which animals 'move()' to call. I've just tried putting in a 'break point' at the end of the 'foreach' and when i hover the mouse over 'pettable' i can see it's a Cat but if i code

    pettable.

    i can only access the methods in 'pettable' not in the Cat class ? Thats the methods i'd like access to. Sorry, i know thats a bitconfusing. Thanks Neil

    modified on Friday, December 5, 2008 12:48 PM

    C# question

  • TabControl question
    N nlowdon

    Evning All, Can anyone tell me if it's possible to fire an event (add components to a form) when you click on the tab of a 'TabControl' I've learned that with other components in the form you 'double click' on say.....a button and it automatically takes you generated code that you can add to. However, when designing the form you can't double click on an individual tab so i was wondering i there is such a feature. Regards Neil

    C# question

  • timer problem
    N nlowdon

    Evening all ! I've created a new timer in a form's constructor to make a button on the form flash. For some reason the program is stepping through the code for the timer tick ONCE and thats it ? Would appreciate if someone could take a look at it and tell me whats wrong, it's porbably something trivial and i've just been looking at the code too long now ! Thanks in advance Neil

    public Form1()
    {
    InitializeComponent();

            buttonTimer = new Timer();
            buttonTimer.Tick += new EventHandler(button\_Tick);
            buttonTimer.Interval = (50);
            
            populate.BackColor = Color.Black;
            populate.ForeColor = Color.Orange;
    
            buttonTimer.Start();
        }
    
        void button\_Tick(object sender, EventArgs e)
        {
            if (populate.BackColor == Color.Orange)
            {
                populate.BackColor = Color.Black;
                populate.ForeColor = Color.Orange;
            }
    
            if (populate.BackColor == Color.Black)
            {
                populate.BackColor = Color.Orange;
                populate.ForeColor = Color.Black;
            }
        }
    

    }

    C# adobe help question

  • Extracting List Objects
    N nlowdon

    Afternoon all ! I have populated a list with various animal objects - 'Cat, Dog, Lion, Tiger....' I am stepping through the list in order to have them call specific methods. The Cat & Dog object both have the same method Pet(). None of the other animals in the list have this method. If i implement 2 seperate statments -

    foreach (Cat thisCat in zooAnimals.OfType<Cat>())
    {
    thisCat.pet();
    }

    foreach (Dog thisDog in zooAnimals.OfType<Dog>())
    {
    thisDog.pet();
    }

    the code will work fine. I would like to know for my own benefit if there's a way to concatenate these statements into 1 i.e

    foreach (Cat thisCat in zooAnimals.OfType<Cat>() || Dog thisDog in zooAnimals.OfType<Dog>())
    {
    thisCat.pet();
    thisDog.pet();
    }

    Thanks in advance Neil

    C#

  • Moving pictureBox
    N nlowdon

    Afternoon all ! I have an application that has a panel with a picturebox within it. Can anyone enlighten me as to how i code to move the pictureBox from one panel to another. Thanks in advance Neil

    C#

  • Graphics ?
    N nlowdon

    Evening all ! I'm working on my first ever uni assignment in c# and would like to smarten up the application a bit. Can anyone point me in the direction of a good site/tutorial etc for implemnting some graphics ? I have a few main form, some panels etc - do i just assign pictures to them the same way as i have done for a picture box ? Also, is there any way of changing a panel so it's not just a square/rectangle shape ? Many thanks Neil

    C# csharp graphics tutorial question

  • Keyboard shortcuts
    N nlowdon

    Afternoon Folks ! I'm looking for some advice on keyboard shortcuts please. I have my system set up so that some of the main windows are minimized at the side of the screen (toolbox, solution explorer etc). I have found the keyboard shortcuts for making these visible/hiding and was wondering if there was another key tap for pinning it in place (turning off the auto hide) ? You know - say i wanted it open t drag a a few components and didn't want it to keep auto-hiding. I know i can 'pin' it with the mouse but would rather use the keyboard. A bit hard to explain i know but hopefully you've understood me. Neil

    C# question

  • Extracting from a list.
    N nlowdon

    Thank you very much indeed - worked a treat !

    C# tutorial question learning

  • Extracting from a list.
    N nlowdon

    Good afternoon all, I'm learning to work with 'Lists' I've set up a list of 'zooAnimals' and in the list i've added objects as they have been created.

            zooAnimals = new List<Animal>();
    
            
            newcat1 = new Cat(cat1, catPen, fircat);
            newcat2 = new Cat(cat2, catPen, seccat);
    
            newtig1 = new Tiger(tiger1, tigerPen, firtig);
            newtig2 = new Tiger(tiger2, tigerPen, sectig);
    
            zooAnimals.Add(newcat1);
            zooAnimals.Add(newcat2);
    
            zooAnimals.Add(newtig1);
            zooAnimals.Add(newtig2);
    

    I would like to now step through the list to perform certain actions when a button is pressed. For example - the form has a number of buttons on it - 1 being for individual groups of animals to eat(). I tried with

            foreach (Cat thisCat in zooAnimals)
            {
                if (thisCat.hunger == 7)
                {
                    thisCat.hunger = thisCat.hunger - 5;
                }
            }
    

    but this code throws an InvalidCast Exception...... Unable to cast object of type 'Zoo_Animals.Tiger' to type 'Zoo_Animals.Cat'. Is there a way of stepping through the list to do this ? Thanks in advance ! Neil

    C# tutorial question learning

  • 'List' help ?
    N nlowdon

    Cristian, my appologies for not being very specific - still getting used to this 'posting' bit ! Ok - my code goes -

            Animal newcat1;
    
            zooAnimals = new List<Animal>();
    
            for (i = 0; i < 2; i++)
            {
                Animal animal = new Animal();
                zooAnimals.Add(animal);
            }
    
            newcat1 = zooAnimals\[0\] as Cat;
            newcat2 = zooAnimals\[1\] as Cat;
    

    the program then throws a 'Null Reference - Object reference not set to an instance of an object.' When i hover the pointer, the 'newcat1' is still set to null

    C# csharp help question learning

  • 'List' help ?
    N nlowdon

    Thanks Cristian, Your reply was v-helpful. I've since tried

    newcat1 = zooAnimals[0] as Cat;

    but this doesn't seem to work either. Can i not cast the object in this way ?

    C# csharp help question learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups