Custom TextBox Full- Rounded, Placeholder, Border-Focus Color, Underlined & Square Style- WinForm C#

Sdílet
Vložit
  • čas přidán 25. 06. 2021
  • 🎬 [ Custom controls in Windows Forms and C# ]
    ⏮ PREVIOUS: Custom Text Box (Part 1: Square & Underline Style) • Custom TextBox - Borde...
    ⏭ NEXT: Custom ComboBox? • Custom ComboBox - Icon...
    ▶ CURRENT VIDEO: How to create a Custom Text Box (Part 2: Rounded Corners & Placeholder)?
    In this tutorial, you will learn how to create a Custom Text Box, We will add some appearance properties, thus obtaining a text box with a very elegant, flat and modern appearance.
    CUSTOM TEXT BOX WITH:
    - Rounded corners (soft)
    - Placeholder
    - Square / rectangular or underlined style
    - Password field
    - Multiline
    - Border color
    - Border color in focused mode
    - Text color
    - And other basic properties and events of a text box.
    🔰 Get Code
    rjcodeadvance.com/custom-text...
    🎦 See all custom controls:
    • Custom Controls C#
    😸Social networking
    Facebook: / rjcodeadvanceen
    Instagram: / rjcodeadvanceen
    🎁 GET RJ CODE MODERN UI - M1 (55% OFF) [ C# || VB.NET ]
    Learn how to create Custom Forms + Custom Controls + Theme and Style Settings
    - Get Project: rjcodeadvance.com/tienda/
    - Download Demo: drive.google.com/uc?id=1uo3yw...

Komentáře • 58

  • @janslanina2209
    @janslanina2209 Před 3 lety +1

    God I love the fact that you are back ! ^_^ Was checking your channel every week If anything new was added. Thank you ! P.S.: if you can make datagridView customisation video I would really appreciate it. :-)

  • @RJCodeAdvanceEN
    @RJCodeAdvanceEN  Před 3 lety +2

    ⏮Watch previous video to do this tutorial: czcams.com/video/CkpUQYzYCC8/video.html
    ▶Current video tutorial content:
    00:00 Introduction
    01:02 Create a Rounded TextBox
    08:48 Create the TextBox Placeholder

  • @oblique9568
    @oblique9568 Před rokem

    You're honestly so amazing, you've helped me a great deal

  • @MarceloCutin
    @MarceloCutin Před 2 lety +1

    Hi there. Excellent video. Let me just give my contribution as a way to say thanks to everything I learned by watching it.
    Inside BorderRadius property code the correct is not checking if the BorderRadius property value informed by the user is positive, but instead if it is equal or smaller than the BorderSize proerty value (it cannot be), otherwise the user may receive an unhandled exception when setting BorderRadius value when the OnPaint code is executed (more precisely on the line it creates the pathBorder GraphicsPath).

  • @khanhieunguyen9470
    @khanhieunguyen9470 Před 2 lety

    It's working for me. Thank you!

  • @user-og9lr9zk4w
    @user-og9lr9zk4w Před 2 lety

    It's amazing!COOL!

  • @sugarnchilly4628
    @sugarnchilly4628 Před 3 lety +2

    you really are advance thank you very much we are very grateful to have such creative work...

  • @saurabhtyagi4209
    @saurabhtyagi4209 Před 3 lety

    Great tutorial sir..

  • @lbnobld
    @lbnobld Před 3 lety +1

    Wowwww ! this is such impressive and creative 😍 Massive thanks for your efforts.
    Could you please make another video for how to design datagridview in the same way 🤗

  • @dhanrajkumar8521
    @dhanrajkumar8521 Před 3 lety

    Good job bro... keep on comtinue
    Thank you very much it helps me lot in my project

  • @carlosdavidtabacon8525
    @carlosdavidtabacon8525 Před 7 měsíci

    Hi Good day everyone and to this channel, it really helps me a lot, i want to have more videoes like this, thank you. Keep up the good work

  • @hbadotti
    @hbadotti Před 2 lety +2

    Awesome video... I got a question, how this affect the overall performance? Does it affect much? I thinking in migrating every textbox like yours

  • @sathsarabj
    @sathsarabj Před 3 lety

    Thank u so much

  • @crisvincentferrer5394
    @crisvincentferrer5394 Před rokem +1

    Hi I have a question , how do you change your form head border color to the same color of you top bar panel?

  • @user-nf4tv8bo2e
    @user-nf4tv8bo2e Před 2 lety

    Looking at it helps a lot. I have a question. How to enable readonly function in TextBox?

  • @Headkiller78
    @Headkiller78 Před rokem

    THX for this never died winforms ,which still has potential to create (customized modern) layouts.
    I used it, and splitted to several classes to have inheritance for animations (morfing), and central class for layout for cross useable many components. i advice to do that to save the time if you need same style for different components. also i advice to add "anti-flickering" peace of code to your control constructor. something like this.
    ... typeof(Panel).InvokeMember("DoubleBuffered",BindingFlags.SetProperty | BindingFlags.Instance | BindingFlags.NonPublic,null, this, new object[] { true });
    it helps much (no flicket and fluent transitions squared=> rounded corners when focused)
    also a little play with this.invalidate() method , it is not necessary (in my case) - save CPU
    please more, more, more.... i will now creating custom smart pagecontrol with tabs with buttons and panel gradiented with rounded corners like widgets

  • @dr.hex8514
    @dr.hex8514 Před 3 lety +3

    Can you make different videos inside the scrollbar and the progressbar?

  • @Adi-fy7tw
    @Adi-fy7tw Před 2 lety +3

    Hi RJ, can you help me to make this custom textbox support AutoComplete-Menu (from CodeProject)?

  • @jarno2427
    @jarno2427 Před 3 lety +2

    Can you make a costum tooltip video please, nice video

  • @mohammad12ba
    @mohammad12ba Před rokem

    Hi RJ, thanks for these rich educating videos, could you help me how to make this (TextBox) read only.

  • @andrewwright9739
    @andrewwright9739 Před 2 lety

    How do I change the text a user inputs into the custom box ?
    I'm taking user input from the text box then once the user presses a button the text is changed. Which event do I need to enable to allow this to happen with a custom text box. Textchangedalign?

  • @user-ft8cp3yq6l
    @user-ft8cp3yq6l Před rokem

    Excellent video is it possible to add the alignment property to the textbox?
    i tried but i was not able to
    can you help me ?

  • @timothyjohnsantiago9726
    @timothyjohnsantiago9726 Před 2 lety +1

    How can I resolve the error Control does not support transparent background colors.?

  • @minmin367
    @minmin367 Před 11 měsíci

    excellent video 12:06

  • @FaktaLain_YT
    @FaktaLain_YT Před 3 lety +3

    Like

  • @brenoleonetti1860
    @brenoleonetti1860 Před 2 lety +1

    how did you change the color of the form's top border? I was searching for it everywhere and everything I found, it just doesn't work

  • @HuyNguyen-fm5gx
    @HuyNguyen-fm5gx Před 2 lety

    Hi RJ, how do you think when you select the checkbox it will show the password

  • @sonr0xz
    @sonr0xz Před 9 měsíci

    I just copy your code but the placeholder is returning to me not the one that I type

  • @ChordCodeCJYG
    @ChordCodeCJYG Před 3 lety

    Massive useful video again. Thanks. your channel is very helpful improve UI design of my Winform project.
    but actually I have some Problem before. Your all code worked perfectly but Visual studio keep showing error "Failed to load toolbox item 'RJControls(textbox,combobox etc.)' it will be removed from the toolbox." when I drag control toolbox to my form. your custom controls only worked when manually adding controls like a "Controls.Add(RJCustomControl)"
    Can i fix this? this issue is made difficultly preview design Form and I can only see form control result after set manually size,location,color.

    • @RJCodeAdvanceEN
      @RJCodeAdvanceEN  Před 3 lety +1

      If you are trying to add the project DLL to the toolbox, you must convert the project to class or control library.

  • @qbiczero
    @qbiczero Před 2 lety

    Really nice Video, the only problem I found ist that ReadOnly Look does not work but can simply be added by generating 2 variables to store the fore and border color in an editing the ReadOnly Property (when readOnly fore- and backcolor to gray, when disabled, reset to values of the 2 new variables).
    The Other Problem is, I'm not able do get the RoundetTextBox to be display correctly when Height is beneath 23, then the bottom line is missing. To get the Height beneath 35 it also had to remove the function UpdateControlHeight because it always Resizes the the Box to minimum of 35. I will have to test if all theys changes will end in any other problems when displaying the textbox

    • @RJCodeAdvanceEN
      @RJCodeAdvanceEN  Před 2 lety

      Yes it's correct. The height of the UserControl must always be greater than the height of the text box, the height of the text box depends on the font size.

  • @adamonjourney3726
    @adamonjourney3726 Před 3 lety

    Hello RJ, in this video you copy method GetFigurePath from RJButton where is used: path.AddArc(rect.RIGHT.... but in your video of RjButton rect.Width and instead of.Bottom -> . Height is used... rect.Right with curveSize= radius * 2F shows control looks like "a fish"... where I am doing wrong and: what version to use? with radius or with curveSize? Thanks :)

    • @RJCodeAdvanceEN
      @RJCodeAdvanceEN  Před 3 lety +2

      Hi Adam,
      Please use the latest version of the code shown as I updated it on GitHub and the website for smoother & sharper curves.
      github.com/RJCodeAdvance/Custom-Button-WinForm/blob/main/RJButton.cs

  • @naturalanimals2
    @naturalanimals2 Před 2 lety

    When I write to many char and Enter ; it doesnt work

  • @batrowtharuka7106
    @batrowtharuka7106 Před rokem

    Why is text input unavailable? "string email = email.Text;" I tried but couldn't

  • @broaxconde6302
    @broaxconde6302 Před 2 lety +1

    Hello rj! Is it possible implementing an icon picture left and right? just like the guna and bunifu winforms? hehe

    • @broaxconde6302
      @broaxconde6302 Před 2 lety

      Thank you for the video. btw! :)

    • @RJCodeAdvanceEN
      @RJCodeAdvanceEN  Před 2 lety +2

      Hello Broax, it is possible to do it, it would simply be to place a PictureBox in the User Control, and set the Dock properties of the internal controls.

  • @bohdanyankovych197
    @bohdanyankovych197 Před 3 lety

    How to resize text box with resize form?

  • @amigopdv6032
    @amigopdv6032 Před 2 lety

    Hi Rj and thnaks for to share it. A question, How to implement the one that only accepts numbers or letters, because there is a possibility that data is entered in the text box as letters instead of numbers. Thank you

    • @RJCodeAdvanceEN
      @RJCodeAdvanceEN  Před 2 lety

      Hi,
      You can create a structure type property, for example, dataType, Numbers, Letters, None.
      Then subscribe the KeyDown event of the textBox, there make the conditions, for example:
      private void textBox_KeyDown (object sender, KeyPressEventArgs e)
      {
      if(_typeData==TypeData.Numbers){
      if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) &&
      (e.KeyChar != '.'))
      {
      e.Handled = true;
      }
      }

    • @amigopdv6032
      @amigopdv6032 Před 2 lety

      @@RJCodeAdvanceEN Sorry I'm New in c# I Try this one on the leave event of each RJTextBox Created, I don't have the solution yet. (My English is not so good yet):
      TextBox1.Text = string.Format("{0:n}", TextBox1.Text);
      double dd = Convert.ToDouble(altoTextBox1.Text);
      string usFormated = dd.ToString("N", new CultureInfo("es-CO"));
      TextBox1.Text = usFormated;
      Maybe the Leave event doesn't is in the properties, and besides I dont Know how to do it. I try again, and study more. Thanks a lot RJ.

  • @robertmuntumosikambang4456

    Rj code, tu n'as pas un site web ?

  • @hectorgonzalez8000
    @hectorgonzalez8000 Před 3 lety +1

    Could you do the same video but with VB?

    • @RJCodeAdvanceEN
      @RJCodeAdvanceEN  Před 3 lety +1

      Soon I will upload these videos on VB.NET.
      However you can do it yourself, it's all the same. The main difference between C # and VB is the semicolon (;) ending at the end of the code.
      You can use this code translators.
      converter.telerik.com/

  • @mikeabordo6655
    @mikeabordo6655 Před měsícem

    these custom textboxes can't read the database :(

  • @robertmuntumosikambang4456

    I would know how to customize a messagebox?

  • @christiannedouyon5315
    @christiannedouyon5315 Před 2 lety

    The textbox is not responsive

  • @richardsantiago594
    @richardsantiago594 Před 2 lety +1

    Execent! but i have a problem txtCodigo.Texts = grdLista.CurrentRow.Cells["depCodigo"].Value.ToString().Trim(); to add value to placeholder not texts?

  • @smkaldi907
    @smkaldi907 Před 2 lety

    thank you for these rich educating videos , i have one suggestion to use Lostfocus event instead of Leave event because Leave event will do the job in 2 steps (if password is true):
    private void textBox1_LostFocus(object sender, EventArgs e)
    {
    this.OnLeave(e);
    IsFocused = false;
    Invalidate();
    SetPlaceholder();
    }
    }

  • @tylerjohannes
    @tylerjohannes Před rokem

    There's an error in my textbox,
    Exception:
    Parameter is not valid.
    Stack Trace:
    at TRY5.HISControls.CustomTextBox.GetFigurePath(Rectangle rect, Int32 radius)
    at TRY5.HISControls.CustomTextBox.OnPaint(PaintEventArgs e)
    How can I fix these? Please help.

  • @maxspeed2247
    @maxspeed2247 Před 2 lety

    Hi,thankYou, bro i put this code into KeyPress event of RJTextBox.Designer.cs to lose focus when i pressed Escape in my keyboard but that's not working :(
    that's my code and 27 is Ascii code of Escape
    "
    private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
    {
    if (e.KeyChar==27)
    {
    this.ActiveControl = null;
    }
    this.OnKeyPress(e);
    }
    "
    when i using this code in keypress of any text box,that's work but i want put this code into your textbox control,for all textbox's

  • @universitapopolareauserlat3568

    Excellent video is it possible to add the alignment property to the textbox?
    i tried but i was not able to
    can you help me ?