textbox

Drawing a TextBox in an extended Glass Frame w/o WPF

六月ゝ 毕业季﹏ 提交于 2019-12-31 05:48:11
问题 I am trying to draw a TextBox on the extended glass frame of my form. I won't describe this technique, it's well-known. Here's an example for those who haven't heard of it: http://www.danielmoth.com/Blog/Vista-Glass-In-C.aspx The thing is, it is complex to draw over this glass frame. Since black is considered to be the 0-alpha color, anything black disappears. There are apparently ways of countering this problem: drawing complex GDI+ shapes are not affected by this alpha-ness. For example,

set padding to dynamic textbox C# asp.net

人走茶凉 提交于 2019-12-31 05:29:13
问题 here is the code I create textbox from C# code.. for (int x = 0; x < 30; x++) { TextBox txt = new TextBox(); txt.ID = "txt - " + x.ToString(); data.Controls.Add(txt); data.Controls.Add(new LiteralControl("<br/>")); } all textbox will be stick to each other.. I wonder can I add padding-top in the loop? how may I do it? thanks for your help and your suggestion and comment is appreaciated. This is create by using C# I wish want got space like this. please ignore the drop down box.. its just

How to put focus to textbox as needed

五迷三道 提交于 2019-12-31 04:09:46
问题 I have a textbox on a userform. If the user fails to enter anything in this textbox, I need to trap that to force an entry. I can do this easily enough, but after notifying the user tht they need to make an entry, I want the focus to return to the textbox. Right now, it doesn't do that. Here is my code: Private Sub txtAnswer_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) Select Case KeyCode Case 13: If Me.txtAnswer.Value = "" Then temp = MsgBox("You need to enter an

Input a button's text into a text box

半腔热情 提交于 2019-12-31 04:01:08
问题 Following on from my last Question Buttons to be renamed by the user which was answered quickly and helped a lot. At the moment I have got this code, which I need to have on 100's of buttons. What I need to know is how to use the text from the button to put into the different text boxes that requires them. If Label4.Text = "Admin" Then With DirectCast(sender, Button) .Text = InputBox("Button Name", "Button Name", .Text) End With Else Me.TransactionBindingSource.AddNew() Product_NameTextBox

How to make text in a WinForms TextBox unselectable without disabling it?

≡放荡痞女 提交于 2019-12-31 03:46:11
问题 Is it possible to make the text in a TextBox unselectable without disabling the TextBox? It's a RichTextBox and I need it's formatting and selection features. I can't disable it because I want to handle MouseMove and MouseDown events. So far I've thought about disabling the Text box and putting a panel on top of it which will delegate it's events to the textbox handlers, but I can't make the panel transparent so it hides the textbox. Thanks. 回答1: What about dealing with the .Enter or

Converting textbox string to float?

可紊 提交于 2019-12-31 03:35:07
问题 I'm basically trying to write a basic converter in visual studio 2008, and I have 2 text boxes, one which gets input from the user, and one which gives output with the result. When I press the button I want the input from the first textbox to multiply by 4.35 then display in the 2nd textbox. This is my code in the button code so far: String^ i1 = textBox1->Text; float rez = (i1*4.35)ToString; textBox2->Text = rez; However I'm getting these errors: f:\microsoft visual studio 9.0\projects

WPF TextBox Inside ViewBox loses Cursor on resize

余生颓废 提交于 2019-12-31 01:56:08
问题 I have a textbox inside a viewbox. When I try to resize the window, the textbox size and font size getting scaled, but if I try to focus the textbox and try move the cursor inside the textbox using keyboard, sometimes the cursor is getting disappeared. Is there a way to show the cursor always? Refer the below code which a TextBox inside ViewBox. <Window x:Class="Resolution_Learning.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft

Data-bound TextBox: can't exit

混江龙づ霸主 提交于 2019-12-30 21:55:06
问题 I've got a text box bound to an object's property (in fact several text boxes) on a form. This for is an editor for an object. When i'm editing some objects and modify values in the one of the text boxes i can't exit from the text box (neither by tab nor clicking on another text box). However that's not always the case - when editing other objects (of the same type) it works fine. Here's a code snipet: txtValue.DataBindings.Add("Text", _SourceObject, "PlannedValue", True, DataSourceUpdateMode

Working with Arrow Keys in a WPF Textbox (C#)

折月煮酒 提交于 2019-12-30 17:23:10
问题 Is there any way to catch the Up/Down arrow keys in a WPF TextBox ( System.Windows.Controls.Textbox ) and allow them to alter the text? I've read about overiding the ProcessCmdKey method for a Windows Forms TextBox ( System.Windows.Forms.TextBox ), and it worked fine, but that TextBox is not nearly as flexible as the WPF one. Is there a similar method to accomplish this without having to use the old Windows Forms TextBox? For my example, I have a TextBox that has a numeric text-mask. I want

Working with Arrow Keys in a WPF Textbox (C#)

强颜欢笑 提交于 2019-12-30 17:23:01
问题 Is there any way to catch the Up/Down arrow keys in a WPF TextBox ( System.Windows.Controls.Textbox ) and allow them to alter the text? I've read about overiding the ProcessCmdKey method for a Windows Forms TextBox ( System.Windows.Forms.TextBox ), and it worked fine, but that TextBox is not nearly as flexible as the WPF one. Is there a similar method to accomplish this without having to use the old Windows Forms TextBox? For my example, I have a TextBox that has a numeric text-mask. I want