textbox

Why do I get “No data exists for the row/column” error when I do have data?

ぃ、小莉子 提交于 2019-12-13 04:44:15
问题 What's meant to happen is that when the a row is double clicked on the database the program should pull the data out of that row and fill it in the text boxes. This is the code I have so far, when double clicking a row I get "No data exists for the row/column". Thanks, Private Sub dtg_Email_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles dtg_Email.DoubleClick Dim conn As New OleDbConnection Dim cmd As New OleDbCommand Dim dr As OleDbDataReader Try conn = New

C# textBox Hex only with 0x/h/$ prefix using TextChanged property

南笙酒味 提交于 2019-12-13 04:42:26
问题 I am testing the following code in TextChanged property to allow only HEX values in the textBox and it works just fine, it also deletes pasted string which doesn't match the HEX pattern and converts the lower to upper case, this is just what I needed: Regex nonhex = new Regex("[^0-9,a-f,A-F]"); int caret = textBox1.SelectionStart - textBox1.Text.Length; textBox1.Text = nonhex.Replace(textBox1.Text, "").ToUpper(); textBox1.SelectionStart = caret + textBox1.Text.Length; If I try to add a prefix

Grief with WPF UserControl with ListBox and TextBox Can't get textwrapping to work

拜拜、爱过 提交于 2019-12-13 04:36:01
问题 I am trying to produce a simple User Control that allows a user to enter notes and review the notes he or she has taken. For now, I have a ListBox to show previous notes and a TextBox to enter a new note. The ListBox also uses TextBoxs to show the individual notes. The logic is all working. Now I'd just like the control to look a little nicer. I am not seeing text wrapping when one of the notes is long. Nor am I seeing text wrapping on the TextBox where I enter a new note. I have tried to

Transfer numbers in textbox to labels in another form c# windows forms

ぃ、小莉子 提交于 2019-12-13 04:32:52
问题 How do you guys actually transfer a numeric value in textbox in Form 2 (which is double) to a label in another form(Form 1) in the correct way and this is what I've done: //Form 2 private void btnok_Click(object sender, EventArgs e) { double exchange; exchange = Double.Parse(txtcurrent.Text); this.ownerForm.PassValue(txtcurrent.Text); this.Close(); } //Form 1 public void PassValue(string strValue) { lblexchange.Text = strValue; } private void update_Click(object sender, EventArgs e) { if

Bind DataGrid TextBox Enable based on Checkbox property [duplicate]

﹥>﹥吖頭↗ 提交于 2019-12-13 04:31:32
问题 This question already has answers here : DataGridTextColumn.IsReadOnly seems to be faulty (6 answers) Closed 6 years ago . I have a DataGrid with a Checkbox & other Textbox. <DataGrid AutoGenerateColumns="False" Height="170" Name="dataGrid1" Width="527" OpacityMask="#FF161A1A" BorderBrush="#FFB7B39D" Background="LightYellow" RowBackground="LightGray" AlternatingRowBackground="#FFFFFFF5" BorderThickness="10" CanUserResizeRows="False" CanUserReorderColumns="False" CanUserResizeColumns="True"

Change a textbox colour when disabled C# [duplicate]

早过忘川 提交于 2019-12-13 04:31:31
问题 This question already has answers here : How to change the font color of a disabled TextBox? (9 answers) Closed 6 years ago . i am going to ask the same thing like other topic which I have seen. When i use the Textbox.Enable or Textbox.readOnly, the textbox gets a dark colour, how can i change this colour for a better colour? (white could be better). 回答1: When a TextBox is disabled, it ignores the ForeColor . You can override this by implementing your custom painting. From the source Thread:-

Clearing a textbox when any other radio buttons are selected

本秂侑毒 提交于 2019-12-13 04:26:10
问题 I started working on some code for a webpage yesterday & i am having trouble getting a few things working. I have 4 radio buttons, 3 of which have values applied to them & one which allows the user to enter a custom amount with a textfield next to it e.g [] = 3 [] = 11 [] = 32 [] = [_________] = Enter Custom Amount The problem is, if a user selects custom amount by pressing the radio button and enters 300 e.g, then afterwards decides to choose a predefined amount of 11 they can still submit

Textbox input range of numbers

馋奶兔 提交于 2019-12-13 04:24:41
问题 I'm trying to handle my textbox input values. I want the user to only be able to input numbers within a range using KeyPress. Ex. (0 - 1000). I have the code to prevent any input thats not a number. I can't quite figure out how to prevent the user from inputting a value thats not within a certain range. Private Sub txt2x6LumberQuanity_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txt2x6LumberQuanity.KeyPress If Not Char.IsNumber(e.KeyChar) And Not Char.IsControl(e.KeyChar) Then e

Textbox Object Reference [closed]

早过忘川 提交于 2019-12-13 04:22:26
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . How can I reference a TextBox object(say textBox1) in another custom class in form1.cs file? In myclass , I've written textBox1 , but intelliSense didn't suggest it to me. Changing private to public doesn't solve

How do I assign the value of a textbox to a variable?

心已入冬 提交于 2019-12-13 04:08:58
问题 How do I assign the value of a textbox to a variable? Here is my form: <form id="" method="post" action="photo_upload.php" enctype="multipart/form-data"> <table align="center" cellpadding="0" cellspacing="0" border="0" width="650px"> <tr> <td colspan="7"> <input type="text" id="albumName" name="albumName" value="jaghamachi"/> </td> </tr> <tr> <td width="50px" align="center"/> <td align="center" width="100px">Upload Pics::</td> <td align="center" width="50px"/> <td align="center" width="200px"