WPFã§NumericUpDown
ãã¦ã³ãã¼ãå ä¹ ãã¶ãã«ä½¿ããã¨ãã¦åç §ã«è¿½å ãããã¨ã©ã¼ ç´ãã¾ã§ã«åã£ãè¡å æ§æããã¼ã¸ã£ã¼ã§ãã©ãããã©ã¼ã ã®å¤æ´ ã¿ã¼ã²ãããã¬ã¼ã ã¯ã¼ã¯ã®å¤æ´ ããã¸ã§ã¯ããã¡ã¤ã«ã®Platformsé ç®ãåé¤ é¸æç¯å²ã®å ¬é ææ³ é¢é£è¨äº ãã¦ã³ãã¼ãå â¦
ãã¦ã³ãã¼ãå ä½æåä½ç°å¢ ç¢ºèª MainWindow.xaml MainWindow.xaml.cs æ§ãã¼ã¸ã§ã³ ä»ãã¼ã¸ã§ã³ æ¸ãæããå ´æ ææ³ ãã¦ã³ãã¼ãå github.com ããã®ControlLibraryCore20200620_v1.2.2.zip ä½æåä½ç°å¢ Windows 10 Home ãã¼ã¸ã§ã³ 2004 Visual Stuâ¦
NumericUpDown1.2.1 ãã¦ã³ãã¼ãå ä½æåä½ç°å¢ æ¹åç¹ XAMLãã¤ã³ãã¨ã©ã¼è§£æ¶ãã ValueChangedã¤ãã³ã追å ãã åä½ãã¹ãã¨ã³ã¼ã åä½ãã¹ãã®MainWindow.xaml åä½ãã¹ãã®MainWindow.xaml.cs é¢é£è¨äº NumericUpDown1.2.1 ãã¦ã³ãã¼ãå github.câ¦
ãã©ã³ããµã¤ãºã«ãã£ã¦ãµã¤ãºå¤å ControlLibraryCore20200620_v1.1.0.7z Releases · gogowaten/userControl https://github.com/gogowaten/userControl/releases github.com è¨å®ä¾ ããããã£å å æ¢å®å¤ 説æ MyValue decimal 0m å¤ MyText String "" Mâ¦
ååã® gogowaten.hatenablog.com ããã« gogowaten.hatenablog.com ãã®ã¨ãã®ãåãå ¥ã㦠ã-0.ãã¨ãã®å ¥åã¨ãæ¸å¼ãè¨å®ã§ããããã«ãªã£ã TextBoxã«æ°åã®å ¥åä¸ã«ãMyValueã«åæ ããããã«ãã æ¸å¼ã®è¨å®ã®å ¥åä¸ã«ãMyTextã«åæ ããããã«ãã â¦
æ°å¤ã¨Bindingããããã¹ãããã¯ã¹ 2020WPF/20200625_decimalTextBox at master · gogowaten/2020WPF github.com ç®ç ããã¹ãããã¯ã¹ã¨æ°å¤åä¾åé¢ä¿ããããã£ã®ãªã¢ã«ã¿ã¤ã é£å æ°å¤åã®ä¾åé¢ä¿ããããã£ã¨TextBoxã®TextPropertyãBinding TextProâ¦
æ¨æ¥ã®ç¶ã ä¸éå¤ã¨ä¸éå¤ãè¨å®ã§ããããã«ãã ä»åã§NumericUpDownã¯å®æ userControl/ControlLibraryCore20200620 at 0624_2341_blog · gogowaten/userControl github.com UserControl.xaml
æ¨æ¥ã®ç¶ãã§ãå¤æ´å¤ã1ã§åºå®ã ã£ãã®ãå¤æ´ã§ããããã«ãã å°å¤æ´ã¯ãã¿ã³ã¯ãªã㯠or ããã¹ãããã¯ã¹ä¸ã§ãã¤ã¼ã«ã大å¤æ´ã¯ãã¿ã³ä¸ã§ãã¤ã¼ã« github.com UserControl.xaml.cs å°å¤æ´å¤ã大å¤æ´å¤ã¨ãã«ä¾åé¢ä¿ããããã£ã§ãååã¯ããããMySmaâ¦
æ¨æ¥ã®ç¶ã æ°åã ãå ¥å å ¥åå¶éã¯ä¸æ¨æ¥ã®ãã³ãããã¦ããã¨ã¯ã¯ãªãã¯ããã¨ãã«æååå ¨é¨ãé¸æããã®ã追å ãã github.com UserControl1.xaml
ç®ç㯠ããããNumericUpDownã¿ãããªã® Visual Studio Community 2019ã.NET CoreãC#ãWPFã§ä½ã£ã¦ã¿ã ããããä½ããªãã¦ããæ¢ãã°ãããã ãããã©ä½ãããããä½ã ä»åã®è¨äºã§ã¯ãè¦ãç®ã ãä½ãã¾ã§ã®æé ããã¾ã§ æ°ããããã¸ã§ã¯ãã®ä½æ é¸â¦
æ°åå ¥åç¨ããã¹ãããã¯ã¹ å ¥åã§ããã®ã¯0ãã9ã¾ã§ã®æ°åã¨ãã¤ãã³"-"ã¨ããªãªã"." ãã¤ãã³ãå ¥åã§ããå ´æã¯å é ã ã github.com MainWindow.xaml
ã¦ã¼ã¶ã¼ã³ã³ããã¼ã«ã®DependencyPropertyãå¤æ´ãããæã«ã¤ãã³ããçºçãããã æ¨æ¥ã®IntegerUpDownã³ã³ããã¼ã«ã®Valueããããã£ããããå¤æ´ãããæã«ä½ãã®å¦çããããã¦ãããã«ã¯ã¤ãã³ãã追å ãããã ãããªã¨ã°ã°ã£ã¦ å¤è¦³ãã«ã¹ã¿ãã¤ãºã§â¦
2å¹´å¾ãã£ã¨ããã®ã§ãã gogowaten.hatenablog.com ãªã®ã§â以ä¸ã®è¨äºã¯ç°¡æçã£ã¦æã 以åã®TextBoxã¨ScrollBarã®çµã¿åããã§ä½ã£ã¦ããWindowsFormã®NumericUpDownã¿ãããªã®ãWPFã®ã¦ã¼ã¶ã¼ã³ã³ããã¼ã«ã§DLLã§ä½ã£ã æ±ããæ°å¤ã¯æ´æ°ã ã è¨å®ã§ããâ¦
è¿½è¨ ç°¡åãããªãã®ã¯ãã£ã¡ WPFã«ãNumericUpDownã¿ãããªã®ãã¦ã¼ã¶ã¼ã³ã³ããã¼ã«ã§ããã®9ãä¸å ·åä¿®æ£ - åå¾ãã¦ãã®ãã㰠追è¨ããã¾ã§ WindowsFormã¢ããªã®NumericUpDownã³ã³ããã¼ã« æ°´è²ã®ä¸¸ã®ã¨ããããã 便å©ã ãããããªãµãã«ãããã使ã£â¦