diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButton.sln b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButton.sln new file mode 100644 index 0000000..bc0d631 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButton.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.421 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutocompleteDeleteButtonCS", "AutocompleteDeleteButtonCS\AutocompleteDeleteButtonCS.csproj", "{899924BA-EF3B-44DC-AE88-0CC5C3E0B7DD}" +EndProject +Project("{F184B08F-C81C-45F6-A57F-5ABD9991F28F}") = "AutocompleteDeleteButtonVB", "AutocompleteDeleteButtonVB\AutocompleteDeleteButtonVB.vbproj", "{F1540072-0EA3-4BFC-843F-B3F404D0CAC6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {899924BA-EF3B-44DC-AE88-0CC5C3E0B7DD}.Debug|x86.ActiveCfg = Debug|x86 + {899924BA-EF3B-44DC-AE88-0CC5C3E0B7DD}.Debug|x86.Build.0 = Debug|x86 + {899924BA-EF3B-44DC-AE88-0CC5C3E0B7DD}.Release|x86.ActiveCfg = Release|x86 + {899924BA-EF3B-44DC-AE88-0CC5C3E0B7DD}.Release|x86.Build.0 = Release|x86 + {F1540072-0EA3-4BFC-843F-B3F404D0CAC6}.Debug|x86.ActiveCfg = Debug|x86 + {F1540072-0EA3-4BFC-843F-B3F404D0CAC6}.Debug|x86.Build.0 = Debug|x86 + {F1540072-0EA3-4BFC-843F-B3F404D0CAC6}.Release|x86.ActiveCfg = Release|x86 + {F1540072-0EA3-4BFC-843F-B3F404D0CAC6}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {F5F5D98A-87DC-4C0A-AB8B-79601A03A07E} + EndGlobalSection +EndGlobal diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/App.config b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/App.config new file mode 100644 index 0000000..dcc6592 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/AutocompleteDeleteButtonCS.csproj b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/AutocompleteDeleteButtonCS.csproj new file mode 100644 index 0000000..43a8738 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/AutocompleteDeleteButtonCS.csproj @@ -0,0 +1,125 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {899924BA-EF3B-44DC-AE88-0CC5C3E0B7DD} + WinExe + Properties + _1389443 + _1389443 + v4.7.2 + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + app.manifest + + + + False + ..\..\..\..\Desktop\DLL\Telerik_UI_For_WinForms_2019_1_219_Dev_dlls\Bin40\RadControlSpy.dll + + + + + + + + + + + + + + + Form + + + RadForm1.cs + + + + RadForm1.cs + + + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + + + {47e6ba89-8e32-4be0-baca-e1d1a650766d} + Telerik.WinControls.UI.Design + + + {f5033417-9972-4283-9e08-94ae9134d8f6} + Telerik.WinControls.UI + + + {ad6a4b81-5455-49e3-82d9-5b392b5e2242} + Telerik.WinControls + + + {dc9e1344-9f91-413e-94e4-97ec0ae26c56} + TelerikCommon + + + + + + + + + + \ No newline at end of file diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Program.cs b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Program.cs new file mode 100644 index 0000000..90525e8 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Program.cs @@ -0,0 +1,20 @@ +using System; +using System.Linq; +using System.Windows.Forms; + +namespace _1389443 +{ + static class Program + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + Application.Run(new RadForm1()); + } + } +} \ No newline at end of file diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/AssemblyInfo.cs b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b4f9bde --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("_1389443")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("_1389443")] +[assembly: AssemblyCopyright("Copyright © 2019")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("049db699-5825-4f38-9161-2e903516ed51")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/Resources.Designer.cs b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/Resources.Designer.cs new file mode 100644 index 0000000..e9d352f --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace _1389443.Properties +{ + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("_1389443.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/Resources.resx b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/Settings.Designer.cs b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/Settings.Designer.cs new file mode 100644 index 0000000..d870291 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace _1389443.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase + { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default + { + get + { + return defaultInstance; + } + } + } +} diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/Settings.settings b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/licenses.licx b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/licenses.licx new file mode 100644 index 0000000..f2d5dd0 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/Properties/licenses.licx @@ -0,0 +1 @@ +Telerik.WinControls.UI.RadAutoCompleteBox, Telerik.WinControls.UI, Version=2019.1.219.40, Culture=neutral, PublicKeyToken=5bb2a467cbec794e diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/RadForm1.Designer.cs b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/RadForm1.Designer.cs new file mode 100644 index 0000000..c4d2174 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/RadForm1.Designer.cs @@ -0,0 +1,65 @@ +namespace _1389443 +{ + partial class RadForm1 + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.radAutoCompleteBox1 = new Telerik.WinControls.UI.RadAutoCompleteBox(); + ((System.ComponentModel.ISupportInitialize)(this.radAutoCompleteBox1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this)).BeginInit(); + this.SuspendLayout(); + // + // radAutoCompleteBox1 + // + this.radAutoCompleteBox1.Location = new System.Drawing.Point(166, 54); + this.radAutoCompleteBox1.Name = "radAutoCompleteBox1"; + this.radAutoCompleteBox1.Size = new System.Drawing.Size(522, 75); + this.radAutoCompleteBox1.TabIndex = 0; + // + // RadForm1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1158, 710); + this.Controls.Add(this.radAutoCompleteBox1); + this.Name = "RadForm1"; + // + // + // + this.RootElement.ApplyShapeToControl = true; + this.Text = "RadForm1"; + ((System.ComponentModel.ISupportInitialize)(this.radAutoCompleteBox1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private Telerik.WinControls.UI.RadAutoCompleteBox radAutoCompleteBox1; + } +} \ No newline at end of file diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/RadForm1.cs b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/RadForm1.cs new file mode 100644 index 0000000..46dc464 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/RadForm1.cs @@ -0,0 +1,105 @@ +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; +using Telerik.WinControls.RadControlSpy; +using Telerik.WinControls.UI; + +namespace _1389443 +{ + public partial class RadForm1 : Telerik.WinControls.UI.RadForm + { + + + public RadForm1() + { + InitializeComponent(); + radAutoCompleteBox1.TextBoxElement.ListElement.CreatingVisualItem += ListElement_CreatingVisualItem; + new RadControlSpyForm().Show(); + + for (int i = 0; i < 10; i++) + { + radAutoCompleteBox1.AutoCompleteItems.Add("Item" + i); + } + radAutoCompleteBox1.TextBoxElement.AutoCompleteDropDown.PopupClosing += AutoCompleteDropDown_PopupClosing; + radAutoCompleteBox1.ListElement.ItemHeight = 30; + } + + private void AutoCompleteDropDown_PopupClosing(object sender, RadPopupClosingEventArgs args) + { + if (args.CloseReason == RadPopupCloseReason.Mouse) + { + var popup = sender as RadTextBoxAutoCompleteDropDown; + Point mousePosition = popup.PointToClient(Control.MousePosition); + var item = radAutoCompleteBox1.ListElement.GetVisualItemAtPoint(mousePosition) as CustomVisualItem; + if (item != null) + { + if (item.RemoveButton.BoundingRectangle.Contains(mousePosition)) + { + args.Cancel = true; + } + } + + } + } + + private void ListElement_CreatingVisualItem(object sender, CreatingVisualListItemEventArgs args) + { + args.VisualItem = new CustomVisualItem(); + } + } + + public class CustomVisualItem : RadListVisualItem + { + + LightVisualElement removeButton; + + protected override Type ThemeEffectiveType + { + get + { + return typeof(RadListVisualItem); + } + } + + public LightVisualElement RemoveButton + { + get + { + return this.removeButton; + } + } + + protected override void CreateChildElements() + { + base.CreateChildElements(); + removeButton = new LightVisualElement(); + removeButton.DrawImage = true; + removeButton.Image = Image.FromFile(@"..\..\delete.png").GetThumbnailImage(25, 25, null, IntPtr.Zero); + removeButton.Click += RemoveButton_Click; + removeButton.ImageAlignment = ContentAlignment.MiddleRight; + removeButton.NotifyParentOnMouseInput = false; + removeButton.ShouldHandleMouseInput = true; + removeButton.StretchHorizontally = false; + + this.Children.Add(removeButton); + } + + private void RemoveButton_Click(object sender, EventArgs e) + { + var list = this.FindAncestor(); + list.Items.Remove(this.Data); + } + protected override SizeF ArrangeOverride(SizeF finalSize) + { + var result = base.ArrangeOverride(finalSize); + var rectangle = new RectangleF(finalSize.Width - removeButton.DesiredSize.Width, 0, removeButton.DesiredSize.Width, removeButton.DesiredSize.Height); + removeButton.Arrange(rectangle); + return result; + } + } +} diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/RadForm1.resx b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/RadForm1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/RadForm1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/app.manifest b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/app.manifest new file mode 100644 index 0000000..734cc0b --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/app.manifest @@ -0,0 +1,32 @@ + + + + + + + true/PM + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/delete.png b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/delete.png new file mode 100644 index 0000000..c76ece7 Binary files /dev/null and b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonCS/delete.png differ diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/App.config b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/App.config new file mode 100644 index 0000000..dcc6592 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/AutocompleteDeleteButtonVB.vbproj b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/AutocompleteDeleteButtonVB.vbproj new file mode 100644 index 0000000..3696f5e --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/AutocompleteDeleteButtonVB.vbproj @@ -0,0 +1,153 @@ + + + + Debug + x86 + + + 2.0 + {F1540072-0EA3-4BFC-843F-B3F404D0CAC6} + WinExe + AutocompleteDeleteButtonVB.My.MyApplication + AutocompleteDeleteButtonVB + AutocompleteDeleteButtonVB + 512 + WindowsForms + v4.6.1 + + + x86 + true + full + true + true + bin\Debug\ + AutocompleteDeleteButtonVB.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + x86 + pdbonly + false + true + true + bin\Release\ + AutocompleteDeleteButtonVB.xml + 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022 + + + On + + + Binary + + + Off + + + On + + + app.manifest + + + + + + + + + + + + + ..\..\..\..\..\..\Program Files (x86)\Progress\Telerik UI for WinForms R1 2019\Bin40\Telerik.WinControls.dll + True + + + ..\..\..\..\..\..\Program Files (x86)\Progress\Telerik UI for WinForms R1 2019\Bin40\Telerik.WinControls.UI.dll + True + + + ..\..\..\..\..\..\Program Files (x86)\Progress\Telerik UI for WinForms R1 2019\Bin40\TelerikCommon.dll + True + + + + + + + + + + + + + + + + + Form + + + RadForm1.vb + Form + + + + RadForm1.vb + + + + True + Application.myapp + + + True + True + Resources.resx + + + True + Settings.settings + True + + + + + VbMyResourcesResXFileCodeGenerator + Resources.Designer.vb + My.Resources + Designer + + + + + + MyApplicationCodeGenerator + Application.Designer.vb + + + SettingsSingleFileGenerator + My + Settings.Designer.vb + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Application.Designer.vb b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Application.Designer.vb new file mode 100644 index 0000000..67a5cb3 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Application.Designer.vb @@ -0,0 +1,38 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + 'NOTE: This file is auto-generated; do not modify it directly. To make changes, + ' or if you encounter build errors in this file, go to the Project Designer + ' (go to Project Properties or double-click the My Project node in + ' Solution Explorer), and make changes on the Application tab. + ' + Partial Friend Class MyApplication + + _ + Public Sub New() + MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) + Me.IsSingleInstance = false + Me.EnableVisualStyles = true + Me.SaveMySettingsOnExit = true + Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses + End Sub + + _ + Protected Overrides Sub OnCreateMainForm() + Me.MainForm = Global.AutocompleteDeleteButtonVB.RadForm1 + End Sub + End Class +End Namespace diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Application.myapp b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Application.myapp new file mode 100644 index 0000000..f068425 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Application.myapp @@ -0,0 +1,11 @@ + + + true + RadForm1 + false + 0 + true + 0 + 0 + true + diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/AssemblyInfo.vb b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/AssemblyInfo.vb new file mode 100644 index 0000000..a4338d9 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/AssemblyInfo.vb @@ -0,0 +1,35 @@ +Imports System +Imports System.Reflection +Imports System.Runtime.InteropServices + +' General Information about an assembly is controlled through the following +' set of attributes. Change these attribute values to modify the information +' associated with an assembly. + +' Review the values of the assembly attributes + + + + + + + + + + +'The following GUID is for the ID of the typelib if this project is exposed to COM + + +' Version information for an assembly consists of the following four values: +' +' Major Version +' Minor Version +' Build Number +' Revision +' +' You can specify all the values or you can default the Build and Revision Numbers +' by using the '*' as shown below: +' + + + diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Resources.Designer.vb b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Resources.Designer.vb new file mode 100644 index 0000000..0f47173 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Resources.Designer.vb @@ -0,0 +1,62 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My.Resources + + 'This class was auto-generated by the StronglyTypedResourceBuilder + 'class via a tool like ResGen or Visual Studio. + 'To add or remove a member, edit your .ResX file then rerun ResGen + 'with the /str option, or rebuild your VS project. + ''' + ''' A strongly-typed resource class, for looking up localized strings, etc. + ''' + _ + Friend Module Resources + + Private resourceMan As Global.System.Resources.ResourceManager + + Private resourceCulture As Global.System.Globalization.CultureInfo + + ''' + ''' Returns the cached ResourceManager instance used by this class. + ''' + _ + Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager + Get + If Object.ReferenceEquals(resourceMan, Nothing) Then + Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("AutocompleteDeleteButtonVB.Resources", GetType(Resources).Assembly) + resourceMan = temp + End If + Return resourceMan + End Get + End Property + + ''' + ''' Overrides the current thread's CurrentUICulture property for all + ''' resource lookups using this strongly typed resource class. + ''' + _ + Friend Property Culture() As Global.System.Globalization.CultureInfo + Get + Return resourceCulture + End Get + Set(ByVal value As Global.System.Globalization.CultureInfo) + resourceCulture = value + End Set + End Property + End Module +End Namespace diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Resources.resx b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Settings.Designer.vb b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Settings.Designer.vb new file mode 100644 index 0000000..46c7db4 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Settings.Designer.vb @@ -0,0 +1,73 @@ +'------------------------------------------------------------------------------ +' +' This code was generated by a tool. +' Runtime Version:4.0.30319.42000 +' +' Changes to this file may cause incorrect behavior and will be lost if +' the code is regenerated. +' +'------------------------------------------------------------------------------ + +Option Strict On +Option Explicit On + + +Namespace My + + _ + Partial Friend NotInheritable Class MySettings + Inherits Global.System.Configuration.ApplicationSettingsBase + + Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings) + +#Region "My.Settings Auto-Save Functionality" +#If _MyType = "WindowsForms" Then + Private Shared addedHandler As Boolean + + Private Shared addedHandlerLockObject As New Object + + _ + Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs) + If My.Application.SaveMySettingsOnExit Then + My.Settings.Save() + End If + End Sub +#End If +#End Region + + Public Shared ReadOnly Property [Default]() As MySettings + Get + +#If _MyType = "WindowsForms" Then + If Not addedHandler Then + SyncLock addedHandlerLockObject + If Not addedHandler Then + AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings + addedHandler = True + End If + End SyncLock + End If +#End If + Return defaultInstance + End Get + End Property + End Class +End Namespace + +Namespace My + + _ + Friend Module MySettingsProperty + + _ + Friend ReadOnly Property Settings() As Global.AutocompleteDeleteButtonVB.My.MySettings + Get + Return Global.AutocompleteDeleteButtonVB.My.MySettings.Default + End Get + End Property + End Module +End Namespace diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Settings.settings b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Settings.settings new file mode 100644 index 0000000..85b890b --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/licenses.licx b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/licenses.licx new file mode 100644 index 0000000..f2d5dd0 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/My Project/licenses.licx @@ -0,0 +1 @@ +Telerik.WinControls.UI.RadAutoCompleteBox, Telerik.WinControls.UI, Version=2019.1.219.40, Culture=neutral, PublicKeyToken=5bb2a467cbec794e diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/RadForm1.Designer.vb b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/RadForm1.Designer.vb new file mode 100644 index 0000000..4e0adcb --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/RadForm1.Designer.vb @@ -0,0 +1,56 @@ + _ +Partial Class RadForm1 + Inherits Telerik.WinControls.UI.RadForm + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.RadAutoCompleteBox1 = New Telerik.WinControls.UI.RadAutoCompleteBox() + CType(Me.RadAutoCompleteBox1, System.ComponentModel.ISupportInitialize).BeginInit() + CType(Me, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'RadAutoCompleteBox1 + ' + Me.RadAutoCompleteBox1.Location = New System.Drawing.Point(192, 62) + Me.RadAutoCompleteBox1.Name = "RadAutoCompleteBox1" + Me.RadAutoCompleteBox1.Size = New System.Drawing.Size(457, 129) + Me.RadAutoCompleteBox1.TabIndex = 0 + ' + 'RadForm1 + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(975, 559) + Me.Controls.Add(Me.RadAutoCompleteBox1) + Me.Name = "RadForm1" + ' + ' + ' + Me.RootElement.ApplyShapeToControl = True + Me.Text = "RadForm1" + CType(Me.RadAutoCompleteBox1, System.ComponentModel.ISupportInitialize).EndInit() + CType(Me, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + + End Sub + + Friend WithEvents RadAutoCompleteBox1 As Telerik.WinControls.UI.RadAutoCompleteBox +End Class diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/RadForm1.resx b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/RadForm1.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/RadForm1.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/RadForm1.vb b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/RadForm1.vb new file mode 100644 index 0000000..e14ad8f --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/RadForm1.vb @@ -0,0 +1,80 @@ +Option Infer On +Imports Telerik.WinControls.UI + +Partial Public Class RadForm1 + Inherits Telerik.WinControls.UI.RadForm + + + Public Sub New() + InitializeComponent() + AddHandler RadAutoCompleteBox1.TextBoxElement.ListElement.CreatingVisualItem, AddressOf ListElement_CreatingVisualItem + + + For i As Integer = 0 To 9 + RadAutoCompleteBox1.AutoCompleteItems.Add("Item" & i) + Next i + AddHandler RadAutoCompleteBox1.TextBoxElement.AutoCompleteDropDown.PopupClosing, AddressOf AutoCompleteDropDown_PopupClosing + RadAutoCompleteBox1.ListElement.ItemHeight = 30 + End Sub + + Private Sub AutoCompleteDropDown_PopupClosing(ByVal sender As Object, ByVal args As RadPopupClosingEventArgs) + If args.CloseReason = RadPopupCloseReason.Mouse Then + Dim popup = TryCast(sender, RadTextBoxAutoCompleteDropDown) + Dim mousePosition As Point = popup.PointToClient(Control.MousePosition) + Dim item = TryCast(RadAutoCompleteBox1.ListElement.GetVisualItemAtPoint(mousePosition), CustomVisualItem) + If item IsNot Nothing Then + If item.RemoveButton.BoundingRectangle.Contains(mousePosition) Then + args.Cancel = True + End If + End If + + End If + End Sub + + Private Sub ListElement_CreatingVisualItem(ByVal sender As Object, ByVal args As CreatingVisualListItemEventArgs) + args.VisualItem = New CustomVisualItem() + End Sub +End Class + +Public Class CustomVisualItem + Inherits RadListVisualItem + + Private _removeButton As LightVisualElement + + Protected Overrides ReadOnly Property ThemeEffectiveType() As Type + Get + Return GetType(RadListVisualItem) + End Get + End Property + + Public ReadOnly Property RemoveButton() As LightVisualElement + Get + Return Me._removeButton + End Get + End Property + + Protected Overrides Sub CreateChildElements() + MyBase.CreateChildElements() + _removeButton = New LightVisualElement() + _removeButton.DrawImage = True + _removeButton.Image = Image.FromFile("..\..\delete.png").GetThumbnailImage(25, 25, Nothing, IntPtr.Zero) + AddHandler _removeButton.Click, AddressOf RemoveButton_Click + _removeButton.ImageAlignment = ContentAlignment.MiddleRight + _removeButton.NotifyParentOnMouseInput = False + _removeButton.ShouldHandleMouseInput = True + _removeButton.StretchHorizontally = False + + Me.Children.Add(_removeButton) + End Sub + + Private Sub RemoveButton_Click(ByVal sender As Object, ByVal e As EventArgs) + Dim list = Me.FindAncestor(Of RadListElement)() + list.Items.Remove(Me.Data) + End Sub + Protected Overrides Function ArrangeOverride(ByVal finalSize As SizeF) As SizeF + Dim result = MyBase.ArrangeOverride(finalSize) + Dim rectangle = New RectangleF(finalSize.Width - _removeButton.DesiredSize.Width, 0, _removeButton.DesiredSize.Width, _removeButton.DesiredSize.Height) + _removeButton.Arrange(rectangle) + Return result + End Function +End Class diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/app.manifest b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/app.manifest new file mode 100644 index 0000000..734cc0b --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/app.manifest @@ -0,0 +1,32 @@ + + + + + + + true/PM + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/delete.png b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/delete.png new file mode 100644 index 0000000..c76ece7 Binary files /dev/null and b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/AutocompleteDeleteButtonVB/delete.png differ diff --git a/AutoCompleteBox/AddDeleteButtonToSuggestedItems/description.md b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/description.md new file mode 100644 index 0000000..dc89433 --- /dev/null +++ b/AutoCompleteBox/AddDeleteButtonToSuggestedItems/description.md @@ -0,0 +1,17 @@ +## Environment + + + + + + + + + +
Product Version2018.1 220
ProductRadAutocompleteBox for WinForms
+ + +## Description + +This project shows how yu can add a delete button to the suggested items just like in the latest Outlook version. + \ No newline at end of file