I can compute horizontal and vertical points, but I cant figure out how to compute distance using diagonal points. Can someone help me with this.
here's the code for my horizontal and vertical measuring:
private float ComputeDistance(float point1, float point2)
{
float sol1 = point1 - point2;
float sol2 = (float)Math.A...
Hi there
I have a screen which is divided by a few splitcontainers. One of them contains rectangles which user components I made, these "rectangles" represent hospital beds. What I wanted to do is give users the option to toggle between this "user component view" and a "datagrid view".
So I created a panel pnlPatients which I give the ...
I have a tool strip container in which i have a tool strip.Inside the tool strip i have added three buttons. These buttons are laid out in the vertical tool strip one over another. The distance between the last button and bottom of tool strip is greater than the distance between two buttons. How do i reduce it so that all the buttons loo...
I'm having a windows form. In this form I've datagrid control which has few columns with predefined width.
When I resize the form either by using maximize box or using mouse, datagrid automatically resizes itself to fit the form. This is done using anchor property of the datagrid.
Now I need to resize the width of the columns as well s...
Hi all i write a code to write my last row of datagrid view to a file as follows
private void Save_Click(object sender, EventArgs e)
{
if (dataGridView1.Rows.Count > 0)
{
List<string> lstContent = new List<string>();
foreach (DataGridViewRow row in dataGridView1.Rows)
{
...
How can I sync the scrolling of two multiline textboxes in C# (WinForms)?
When you scroll up/down a line in TextBox A, TextBox B should scroll up/down too.
The same the other way around.
Is this achievable without custom controls?
...
I have noticed the Tag properties with controls. Is it okay to use this to reference my custom objects, or should I stay away from it as it would require boxing and unboxing which has been mentioned as unsafe and is not recomended.
TreeNode tn = new TreeNode ();
CustClass o = new CustClass()
o.number = 123;
tn.Tag = o;
class CustClas...
Yoyo experts!
I have several progressbars on my Windowsform (NOT WPF), and I would like to use different colors for each one.
How can I do this? I've googled , and found that I have to create my own control. But I have no clue , how to do this. Any idea? For example progressBar1 green, progressbar2 red.
Edit: ohh, I would like to solve ...
when my combox style is DropDownList then setting the BackColor works only on that drop down list that we open by clicking on the combobox but it does Not affect the text area of the combobox where we have not yet clicked the combobox to open its list... how can I do that to get the same back color for the text area too ?
...
I have a windows application: a main form and several user controls on it.
Tab button doesn't work as I expected. I thought it goes through all user controls on form. But I was wrong. When user control received focus (using mouse click) it didn't want to go anyway using tab button. What thing can be wrong ? Did I miss something ?
I did...
Iam using a custom control code for my winforms application to create a custom colored progressbar. I can build it, and it works fine, BUT everytime I try to use designer, it crashes. "An error occured while parsing EntityName"
If I add from the toolbox, this is what I get:
http://img188.imageshack.us/f/43680242.jpg/
If I insert a prog...
Hi,
I'm trying to create a pivot of a translation table. Basically the table is like that :
SystemText(Category, Name, LanguageCode, Text)
I have created a model object which has these fields as properties and I'm using NHibernate to get the data from the database.
Now what I want to display is a grid to edit the translations that wi...
I'd like to retrieve the state of the Ctrl keys in a place where I don't have a form.
Normally to get a key state I'd use Control_KeyDown / KeyUp events. However, the code that needs to know whether Ctrl is pressed is outside any form. There is a form displayed, but the code is supposed not to depend on that form but finding the key sta...
For an app I'm building, a requirement is to have the state subtly visible at all times. At first I decided to simply disable the screensaver, but now think it would be preferable to use the scrolling marquee screensaver to indicate state.
Is this possible? How would I go about it?
Since the app will only be installed on a small number...
I am currently working on a project that hosts WinForms designer. I am using PropertyGrid to display manipulate properties of the controls that are dropped on the DesignSurface.
I have created UITypeEditor's to modify values of my custom controls properties.
How can I reset the value of the property to null when Delete key is pressed i...
I started with using a TableLayoutPanel, but when I have big tables, they are extremely sluggish. I'm looking for the responsiveness of an HTML table to display my data in.
The only solution I currently have is to have my WinForm write and HTML table, and display it in an embedded browser. This obviously is a huge workaround, and I'd...
Hello,
Does anyone know of a way to store arbitrary data in a RichTextBox without the user being able to see this data? The 2007 RTF specification includes annotations ("\atnid", "\atnauthor", "\annotation", etc.) but whenever I insert these into a RichTextBox's .Rtf, the annotations disappear (presumably because the RichTextBox doesn'...
Hello, I have an application where I insert one or more System.Drawing.Imaging.Metafiles into a System.Windows.Forms.RichTextBox. I would like to associate arbitrary appliction data with each Metafile image. This way I can recognize the identity of the inserted image later when the user right-clicks on the image and also retrieve infor...
Hi,
I have a window form application, and it has multiple threads running that would invoke on the Main UI thread to update the UI. Occasionally on development machine, the application main UI thread will stop running, and the application no longer responses. It seems to happen if I left the application running overnight. However, I ha...
I'm confused as to how I can get my winforms to scale properly. When I design a form, in my case WVGA, horizontal orientation, it looks like the upper image below. On the device however, the text is scaled to be a lot larger. Setting a lower fontsize in the designer helps me getting it right, but this can't the the correct way of getting...