General Category > Additional Components

New Keypad

<< < (2/3) > >>

Phrog30:
I played around with it.  Thanks for the changes, while I'm still new at this, I like how you show me the correct way to do things. A few questions:
1.  When opening in the designer, it's blank.  The reason I did it the way I had, was that it makes it really easy to edit in the designer.  Am I missing something?
2.  When I called the keypad with min and max values, the minimum setting didn't work correctly, I know it worked in my version, so somehow a bug was introduced or uncovered.

James

Archie:

--- Quote from: Phrog30 on June 18, 2017, 02:42:16 PM ---1.  When opening in the designer, it's blank.  The reason I did it the way I had, was that it makes it really easy to edit in the designer.  Am I missing something?

--- End quote ---
More so a preference of mine to not use a UserControl and the designer when creating controls that are to be used by end users and not edited. It's lighter weight and easier to manage when its a single file. Also probably a bit of old school style programming (and new style because it has come back around) from the days of when there was not designer. The method I used to give the resizing ability would not work with the designer. It would have to be laid out in a TableLayoutPanel for the designer to be able to handle resizing.

--- Quote from: Phrog30 on June 18, 2017, 02:42:16 PM ---2.  When I called the keypad with min and max values, the minimum setting didn't work correctly, I know it worked in my version, so somehow a bug was introduced or uncovered.

--- End quote ---
Very well could have been something I did. I will double check it.

Archie:
I tried this code:

        '* Show in a larger size
        kpd.MinValue = 0
        kpd.MaxValue = 99

        kpd.KeypadWidth = 700
        kpd.ShowDialog()

And when I enter a value out of the limits, it turns red and disables the Accept button

Phrog30:

--- Quote from: Archie on June 18, 2017, 02:56:32 PM ---I tried this code:

        '* Show in a larger size
        kpd.MinValue = 0
        kpd.MaxValue = 99

        kpd.KeypadWidth = 700
        kpd.ShowDialog()

And when I enter a value out of the limits, it turns red and disables the Accept button

--- End quote ---

When using a negative min value the correct value occurs on load, but once you hit a button the value goes to zero.  I tried several times with the same results.  This didn't happen on mine.

Archie:
The Setter for the AllowNegatives property was not setting the field value of m_AllowNegative:

            m_AllowNegatives = value

Is the AllowNegatives property really needed since setting MinValue to >=0 could indicate the same thing?

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version