textbox

VB.Net binding datagridview Comboboxcolumn to datagridviewTextboxColumn

耗尽温柔 提交于 2019-12-12 15:08:30
问题 I am loading data from two tables: institute and country. Institute has 3 columns: instId, name, countryId. And country has 2 columns: countryId, name where countryId is a foreign key from country table. I fill these two tables in dataset. I have datagridview and set its datasource to institute table in my dataset. I also create datagridviewcomboboxcolumn and bind it country table. Have a look to the following code: Public Class frmDGV Dim sqlConn As SqlConnection Dim dsOptions As DataSet Dim

making a .NET TextBox work FIFO style

末鹿安然 提交于 2019-12-12 14:10:02
问题 I have a win GUI application written in C#, in which I have a TextBox component that I write my log to. at some point it gets too loaded and the entire app is starting to falter. I'd like to make an efficient mechanism to make it a FIFO, meaning - make it a fixed size and deleting the oldest content automatically. is there any .net/c# feature for doing that? otherwise, what will be the right way to do this? UPDATE : I also have this issue with other sort of textual data, and not only with

SSRS - Conditional Text Formatting (Expressions using Switch)

倖福魔咒の 提交于 2019-12-12 13:35:09
问题 I will open this up by stating that the expressions do work within the report. The problem is they aren't working together. I currently have a column header formatted based on the values of two columns. Italics and underlined based on the value of Column1. Bold and a specific color based on the value of Column2. I am doing this by using Switch expressions in the text properties. Here is what I have for each: =Switch(Fields!Column1.Value <> "Specific Value","Italic",Fields!Column1.Value =

Winforms/C#: Store/Retrieve (Persist) Content of TextBoxes between 2 Runs

六月ゝ 毕业季﹏ 提交于 2019-12-12 13:28:33
问题 Is there an easiest way to simply tell Winforms (mainly TextBoxes) to persist all its content e. g. to a file without me having to loop through all the controls? I saw this in a WPF application, but am clueless (also, Google did not turn up anything) whether there is an out-of-the-box, easiest approach. Again, looping through each control would be possible but seems.. too much work? Would serialization maybe work? 回答1: You can set your ApplicationSettings PropertyBinding in the Form Designer,

Using C#, how do I set tab positions in a multiline textbox?

試著忘記壹切 提交于 2019-12-12 10:56:14
问题 Is there a graceful way to set custom tab sizes/positions in a multiline textbox in C#? 回答1: You need to send the EM_SETTABSTOPS message, like this: static class NativeMethods { [DllImport("user32.dll")] public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 Msg, IntPtr wParam, ref int lParam); } static void SetTabs(TextBox box) { //EM_SETTABSTOPS - http://msdn.microsoft.com/en-us/library/bb761663%28VS.85%29.aspx int lParam = 16; //Set tab size to 4 spaces NativeMethods.SendMessage(box

Changing the forecolor and backcolor of text in a textbox

限于喜欢 提交于 2019-12-12 10:52:06
问题 I'm making a C++ code editor application using VB.NET. I'd like to change the color of the keywords as the user types it. Also I'm looking for a way to highlight some lines of the code. Is there a way to change the forecolor and backcolour of a piece of text inside a textbox or a rich textbox? 回答1: I do not really know what you want to do so here are some options. If you want a step by step tutorial on how to write a syntax highlighting control, you can read these articles: Syntax

Textbox Binding to both LostFocus and Property Update

血红的双手。 提交于 2019-12-12 10:48:50
问题 Currently I bind to my TextBox es as: Text="{Binding DocValue, Mode=TwoWay, ValidatesOnDataErrors=True, UpdateSourceTrigger=PropertyChanged}" This works great in getting every keystroke to do button status checking (which I want). In addition, I would like to track the LostFocus event on the TextBox (through binding) and do some additional calculations that might be too intensive for each keystroke. Anyone have thoughts on how to accomplish both? 回答1: Bind a command to the TextBox LostFocus

Is it possible to have differently colored lines in multiline text box?

回眸只為那壹抹淺笑 提交于 2019-12-12 10:43:58
问题 Is it possible to have differently colored lines in multiline text box? I'm adding data to the text box and I want to clarify for the user different types of text by color. How to do this if it's possible? 回答1: You can do this if you use a RichTextBox control. See the documentation here (particularly look at the Remarks and Examples sections). The standard TextBox does not offer this capability. 回答2: The standard Winforms textbox does not have this ability (and adding it would be troublesome)

Truncate textbox content with ellipsis in SSRS

不羁的心 提交于 2019-12-12 10:40:48
问题 By default, when the contents of a textbox in SSRS overflows the width of the textbox, the textbox will grow vertically to accommodate its content. This feature can be turned off, by setting the "CanGrow" property of the textbox to "False". However, this abruptly cuts off the content, which is not ideal. I am looking for a way to clearly show the user that the text is too wide to fit the textbox. In the past, I've been using a simple expression to add an ellipsis "...", when the length of the

How do I set a textbox to multi-line in SSRS?

霸气de小男生 提交于 2019-12-12 10:33:34
问题 I have a report with many fields that I'm trying to get down to 1 page horizontally (I don't care whether it's 2 or 200 pages vertically... just don't want to have to deal with 2 pages wide by x pages long train-wreck). That said, it deals with contact information. My idea was to do: Name: Address: City: State: ... Jon Doe Addr1 ThisTown XX ... Addr2 Addr3 ----------------------------------------------- Jane Doe Addr1 ThisTown XX ... Addr2 Addr3 -----------------------------------------------