m66n / ipaddresscontrollib Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/ipaddresscontrollib
License: Other
Automatically exported from code.google.com/p/ipaddresscontrollib
License: Other
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.
The NuGet package for this only supports .Net Framework, could it be updated to support .Net Core/5.0 and up?
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
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();
}
}
}
Both versions have calls to Graphics.FromHwnd() that do not call Dispose()
on the returned Graphics object.
Original issue reported on code.google.com by [email protected]
on 24 Sep 2007 at 4:49
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
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?
it is very important action.
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
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.
This will yield a more accurate width and conserve horizontal space.
Original issue reported on code.google.com by [email protected]
on 11 Jun 2007 at 9:26
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
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?
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
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.
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
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.
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.
Double clicking the control in the designer generates a private void ipAddressControl1_Click(object sender, EventArgs e)
method. This doesn't make much sense.
Found the answer to it here: http://stackoverflow.com/a/22601554/5815327
I guess [DefaultEvent("TextChanged")]
would make the most sense.
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?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.