Coder Social home page Coder Social logo

ipaddresscontrollib's People

Contributors

deantwo avatar m66n avatar stamepicmorg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ipaddresscontrollib's Issues

Can you add this library to Nuget?

NuGet is the package manager for the Microsoft development platform including .NET. The NuGet client tools provide the ability to produce and consume packages. The NuGet Gallery is the central package repository used by all package authors and consumers.

And users can install it directly from visual studio 2013\2015.

Thanks.

Lower Field Range Bypassed by Copy-Paste

public Form1()
{
    InitializeComponent();
    ipAddressControl1.SetFieldRange(0, 100, 200);
    ipAddressControl1.SetFieldRange(1, 100, 200);
    ipAddressControl1.SetFieldRange(2, 100, 200);
    ipAddressControl1.SetFieldRange(3, 100, 200);
}

private void ipAddressControl1_TextChanged(object sender, EventArgs e)
{
    richTextBox1.AppendText(ipAddressControl1.Text + Environment.NewLine);
}

When I paste in "222.210.210.201" it does as expected and print:

200...
200...
200.200..
200.200..
200.200.200.
200.200.200.
200.200.200.200
200.200.200.200

But when I paste in "10.10.10.1" it doesn't respect the field range and print:

10...
10.10..
10.10.10.
10.10.10.1

Removing focus from a field makes the field update and change to be inside the range, but in the most cases this only means that the first field is changed unless you specifically give focus to each field.
This leaves it open to get non-valid IP addresses.

Also, large negative values such as "-53.-53.-473.-26" seems to be handled really weird:

100...
100...
100.100..
100.100..
100.100.-473.
100.100.-473.100
100.100.-473.100

My suggestion: Use Win32 API SysIPAddress32 Control

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace IPTextBox
{
public partial class IPAddressBox : TextBox
{
protected override CreateParams CreateParams
{
get
{
CreateParams cp = base.CreateParams;
cp.ClassName = "SysIPAddress32";//Use Win32 API SysIPAddress32 Control
return cp;
}
}

    public IPAddressBox() : base()
    {
        InitializeComponent();
    }
}

}

KeyPress, GotFocus, LostFocus events not raised

Due to the nature of using nested controls within a UserControl-based
class, some events are either inconsistently raised or not raised at all.
The control should raise KeyPress, GotFocus, and LostFocus events properly.

Original issue reported on code.google.com by [email protected] on 2 Jul 2007 at 10:58

License clarification

I am not a lawyer, but looking at the license for this library it reads like I have to include that full notice, which would then tell my users that they can make copies of and sell "the 'Software'" (my software).

Is this what was intended?

Support pasting?

This is a very nice control. Would it be possible to support pasting an address 
like in WC_IPADDRESS? It lets you do it via ctrl-v or the context menu (which 
appears to be disabled here). Thanks!

Original issue reported on code.google.com by [email protected] on 13 Mar 2012 at 8:27

NullReferenceException when disposing and control has focus

There is a NullReferenceException when disposing and control has focus.

When disposing, the FieldControls and LabelControls are disposed.
The base.Dispose(disposing) is then called.

A NullReferenceException is thrown from inside the base.Dispose().
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at IPAddressControlLib.IPAddressControl.get_Focused()
at IPAddressControlLib.IPAddressControl.OnLostFocus(EventArgs e)
at System.Windows.Forms.Control.WmKillFocus(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

It appears that get_Focused() accesses the null _fieldControls causing the exception.

Please make a release

Hello Michael,

would it be possible to make a release, i.e. to set a version tag?

This would make my live easier in regards of configuration management.

Kind regards,
Mark

problem drawing on ultrawide monitors

Hi.
I noticed that control have problem drawing on ultrawide monitors, with 2560x1080 resolution.
4 the cell is drawn outside the frame.
Have you ever encountered this problem?

Delete key is not deleting values. It is working for Backspace key.

What steps will reproduce the problem?
1. enter valid IP values in the control
2. use backspace button to clear all values
3. now fill values one more time, go to the first field by pressing home 
key on the keyboard and press delete key to clear all the entries in the 
control.

What is the expected output? What do you see instead?
It should start clearing value of the control

What version of the product are you using? On what operating system?
Revision44

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 26 May 2009 at 9:45

.NETFramework,Version=v4.5

Could not install package 'IPAddressControlLib 1.3.5942.27121'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

Don't override AutoSize

According to MSDN, AutoSize is "not intended to be used directly from your
code." Rename the current AutoSize property to AutoHeight to avoid any issues.


Original issue reported on code.google.com by [email protected] on 5 Jun 2007 at 8:35

Click zone

If you click between dots and number it does do nothink. For select number you must click directly on number. Can by zone for clicking expanded for whole number box.

Problem in Validating and Validated Events

hello m66n,

First I would like to thank you for this great work...
But at the practical scenario, when you add many IPAddressControl Controls (ex. for IP, subnet mask, default gateway... etc) , it causes confusion to the events (Validating and Validated) they hang to the first control and don't work for the second, third, fourth... Controls.

for example:

        private void IPv4_Validating(object sender, CancelEventArgs e)
        {
            if (IPv4.AnyBlank) { IPv4.BackColor = Color.Red; e.Cancel = true;}
            else{e.Cancel = false;}
        }
        private void IPv4_Validated(object sender, EventArgs e)
        {
           IPv4.BackColor = Color.Green;
        }

       private void Subnet_Validating(object sender, CancelEventArgs e)
        {
            if ( Subnet.AnyBlank) {  Subnet.BackColor = Color.Red; e.Cancel = true;}
            else{e.Cancel = false;}
        }
        private void  Subnet_Validated(object sender, EventArgs e)
        {
            Subnet.BackColor = Color.Green;
        }

       private void Gateway_Validating(object sender, CancelEventArgs e)
        {
            if ( Gateway.AnyBlank) {  Gateway.BackColor = Color.Red; e.Cancel = true;}
            else{e.Cancel = false;}
        }
        private void  Gateway_Validated(object sender, EventArgs e)
        {
            Gateway.BackColor = Color.Green;
        }

Whatever is the action to take inside these two events, the second and third controls (in the given example Subnet and Gateway) they don't do the required actions, instead only the BackColor of the first control (IPv4) is changed, moreover the application can't be closed by any mean!

When I tried to remove "e.Cancel = true;" nothing changes in the Controls problem, but the Applicatopn can be closed normally.

What do you think the reason of this problem?
I think it's something related to Disposing the Control event when it's done...
Any idea/solution would be highly appreciated.

Thanks in advance.

NuGet Confusion

I just noticed that I am using the wrong NuGet in one of my projects.

I was seemingly using this: https://www.nuget.org/packages/IPAddressControl

It looks like it is a much older version of this project, and I can't seem to find IPAddressControlLib's NuGet in the VisualStudio search feature at all.

Maybe https://www.nuget.org/packages/IPAddressControlLib and https://www.nuget.org/packages/IPAddressControl should be merged or something? I don't know how NuGet handles stuff like this.

Also it looks like the NuGet shield is broken for some reason, is https://www.nuget.org/packages/IPAddressControlLib out of order or something?
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.