• (2 Pages)
  • +
  • 1
  • 2

Building an application - POS/Cash Register - Part one Custom keyboard and inheritence

#16 J.Hickin91  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 19-May 15

Posted 02 July 2015 - 03:13 PM

View PosttlhIn`toq, on 02 July 2015 - 02:58 PM, said:

This sounds familiar - Is this out of my tutorial?

FYI - The controls you make in your project DO show in the toolbox for VS2013 and VS2015. This feature has NOT been removed.

Update: Confirmed this is from that tutorial.

J.: In the future it will help everyone if you say *where* you are quoting from. Its only dumb luck that I saw that and it sounded familiar to me.


Hi, sorry

I got admin on my back as the account i sent the last question on shouldnt have been made. Didn't think to get your username before coming off it.

I have done everything in the tutorial but i cannot find the items in the toolbox after running the program. any ideas??

is there anything else i can add onto here to help?
Was This Post Helpful? 0
  • +
  • -

#17 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 4181
  • View blog
  • Posts: 13,334
  • Joined: 05-May 12

Posted 02 July 2015 - 03:17 PM

I didn't follow the tutorial, but just did an abbreviated create a WinForms project and then a Windows Control Library project. It still shows up in the toolbox for me:
Attached Image

At first it didn't show up for me, but it was because I'd not done any WinForm stuff in years and forgot to make the controls library a dependency. (Of course that problem would have been dead obvious the minute I tried to create my custom form since I'll notice that I'm missing the reference/dependency.)
Was This Post Helpful? 0
  • +
  • -

#18 J.Hickin91  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 19-May 15

Posted 02 July 2015 - 03:22 PM

It doesn't for me. How do i upload a screenshot onto here?

Make it a dependency?
Was This Post Helpful? 0
  • +
  • -

#19 tlhIn`toq  Icon User is offline

  • Freelance developer
  • member icon

Reputation: 6055
  • View blog
  • Posts: 13,325
  • Joined: 02-June 10

Posted 02 July 2015 - 03:26 PM

View PostJ.Hickin91, on 02 July 2015 - 04:22 PM, said:

It doesn't for me. How do i upload a screenshot onto here?


Below the reply box is a button for "use full editor" - Click that
Now that you have the full editor, at the bottom is a button for browse and attach this file.

Attached Image

Then place the cursor in the text where you want the picture and click the "add to post" link
Was This Post Helpful? 0
  • +
  • -

#20 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 4181
  • View blog
  • Posts: 13,334
  • Joined: 05-May 12

Posted 02 July 2015 - 03:27 PM

To configure the dependencies:

In the Solution Explorer: Right click on the project, Build Dependencies>Project Dependencies...
OR
On the Main Menu: Project.Project Dependencies...
Was This Post Helpful? 0
  • +
  • -

#21 J.Hickin91  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 19-May 15

Posted 02 July 2015 - 03:29 PM

Controls Library isn't in the dependencies. only the other forms?
Was This Post Helpful? 0
  • +
  • -

#22 tlhIn`toq  Icon User is offline

  • Freelance developer
  • member icon

Reputation: 6055
  • View blog
  • Posts: 13,325
  • Joined: 02-June 10

Posted 02 July 2015 - 03:32 PM

J.: Sorry for how this sounds but... Did you follow the tutorial from the start? It seems odd that out of a couple hundred people to work that tutorial this issue hasn't come up until now.

May I suggest you start with a fresh new Visual Studio solution and build it again? Most of it is copy/paste anyway so it shouldn't take a ton of time.

Also, in the future if you're having trouble with a tutorial comment on the tutorial page so the author will be made aware and all the help for the tutorial is with the tutorial for the next person that might have a similar problem.

Threads merged
Was This Post Helpful? 1
  • +
  • -

#23 J.Hickin91  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 19-May 15

Posted 02 July 2015 - 03:59 PM

Okay, will type it all again. Though I have gone over it multiple times. will restart my VS2013 aswell.
Was This Post Helpful? 0
  • +
  • -

#24 J.Hickin91  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 19-May 15

Posted 02 July 2015 - 04:12 PM

Found the Error. Didn't even realize i had made it until I created the fresh start. I added 2 new Window Form Programs instead of 2 Class Library programs :D

Feel like such a tit.

Thankyou
Was This Post Helpful? 0
  • +
  • -

#25 J.Hickin91  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 19-May 15

Posted 02 July 2015 - 04:41 PM

I have lost it again.. at the same place.

I am sure i have followed all the instructions. But i still have no items in toolbox.

What am i doing wrong??
Was This Post Helpful? 0
  • +
  • -

#26 tlhIn`toq  Icon User is offline

  • Freelance developer
  • member icon

Reputation: 6055
  • View blog
  • Posts: 13,325
  • Joined: 02-June 10

Posted 02 July 2015 - 04:57 PM

Its been a long time since I created this tutorial. WinForms is not the way we do things anymore. I don't even have this tutorial on my hard drive any more. Which in this case is a good thing. In the morning I'll follow this tutorial as a student and rebuild it. I'll either find the missing step, or not be able to re-create the problem. Either way we have something meaningful from a diagnostic stand point.
Was This Post Helpful? 1
  • +
  • -

#27 tlhIn`toq  Icon User is offline

  • Freelance developer
  • member icon

Reputation: 6055
  • View blog
  • Posts: 13,325
  • Joined: 02-June 10

Posted 02 July 2015 - 05:24 PM

Got to it tonight - I had 5 minutes while the wife was on the phone to her sister.

Ah ha... I think I may have found the source of your confusion.

Are you aware that the toolbox is context-aware? If you are looking that the .cs file for the logic behind the control it won't show you drag-dropable controls because you can't drag a control onto the c-sharp code file?

Attached Image


If you are looking at the designer for a form or user control, then the toolbox will show you the controls that are valid for dragging onto that designer.

So if you are looking at the designer for the generic keypad you are shown the RegisterKeypad as available to you.

Attached Image

If you are looking at the designer for the register keypad you are shown the GenericKeypad as available to you.

Attached Image

This post has been edited by tlhIn`toq: 02 July 2015 - 05:25 PM

Was This Post Helpful? 1
  • +
  • -

#28 J.Hickin91  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 19-May 15

Posted 03 July 2015 - 10:56 AM

Hey,

Well I am shocked. Couldn't get it to work so started again. Ran a build on both the GenericKeypad and RegisterKeypad before putting the buttons on, and the items have arrived in the toolbox. Thank you for your help. Hopefully they will now stay in there whilst i build the keypad.

Hopefully I can sail through this tutorial now. Though as I am using VS13, I may be back with further advice/ questions.

Cheers tlhIn`toq
Was This Post Helpful? 0
  • +
  • -

#29 J.Hickin91  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 19-May 15

Posted 03 July 2015 - 11:18 AM

Okay, I have the keypad on the screen. but the numbers do not appear in the textbox.

I have copied the code i have, maybe i have it down wrong:

#region Events
        public event KeyPressEventHandler ButtonPressed;
        #endregion Events

        #region Methods
        public void RaiseButtonPressed(char WhatToSend)
        {
            KeyPressEventHandler handler = ButtonPressed;
            if (handler != null)
            {
                handler(this, new KeyPressEventArgs(WhatToSend));
            }
        }
        #endregion Methods



 public partial class RegisterKeypad : GenericKeypad
    {
        public RegisterKeypad()
        {
            InitializeComponent();
        }

        private void btn1_Click(object sender, EventArgs e)
        {
            RaiseButtonPressed('1');
        }

        private void btn2_Click(object sender, EventArgs e)
        {
            RaiseButtonPressed('2');
        }

        private void btn3_Click(object sender, EventArgs e)
        {
            RaiseButtonPressed('3');
        }

        private void btn4_Click(object sender, EventArgs e)
        {
            RaiseButtonPressed('4');
        }

        private void btn5_Click(object sender, EventArgs e)
        {
            RaiseButtonPressed('5');
        }

        private void btn6_Click(object sender, EventArgs e)
        {
            RaiseButtonPressed('6');
        }

        private void btn7_Click(object sender, EventArgs e)
        {
            RaiseButtonPressed('7');
        }

        private void btn8_Click(object sender, EventArgs e)
        {
            RaiseButtonPressed('8');
        }

        private void btn9_Click(object sender, EventArgs e)
        {
            RaiseButtonPressed('9');
        }

        private void btn0_Click(object sender, EventArgs e)
        {
            RaiseButtonPressed('0');
        }

        private void btn00_Click(object sender, EventArgs e)
        {

        }

        private void btnEnter_Click(object sender, EventArgs e)
        {

        }

        private void btnPlus_Click(object sender, EventArgs e)
        {

        }

        private void btnMinus_Click(object sender, EventArgs e)
        {

        }

    }



Am i sending it wrong? it seems to jump over the if statement in the top part of code...
Was This Post Helpful? 0
  • +
  • -

#30 J.Hickin91  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 19-May 15

Posted 03 July 2015 - 01:57 PM

Sorted It :D I missed the bit that said about clicking on the event in the properties bar. So i typed the code in manually. Obviously it didn't like it.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2