I've got a windows form object that contains 3 objects, a treeview, a richtextbox, and a tabcontrol. They are not docked into the windows form, but they are anchored (top+left).
I've written the code to resize them when a form-resize event handler gets called, but it only seems to be working for an increase of form size, that is to say...
I have a Windows form application which exit to a system tray Notifyicon and I have tried calling Application.Exit() or Me.Close() to close the program. But neither works to close the program. What is the correct way to close it?
...
Hi fellows,
Could someone help me in detecting changes in any control of the form in c#?
A i have many controls on one form and i need to disable a button if anyof teh control value in the form changes.I am in search of some built-in function/event-handler/property, and don't want to make a customized function for that.
Please guide me...
I have a alarm clock Winform program with a .wav sound. I would like to bundle the sound file into the exe file so that it is easier to distribute. How can I do this?
...
Is there anyway to have the autocomplete for a combo box to start from anywhere in the text, let me give you an example. If I have someone named john smith in the combobox if I start with the letter 'j' it pulls up john smith but less say I want to start with the letter 's' to search for his last name, is that possible, if so does anyone...
I have a simple application:
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
}
Co...
How to bind a combobox with the datatable containing two columns. String and Image.
When I am setting valueMember then an error is thrown.
Argument Exception was unhandled
Cannot bind to the new value member.
Parameter name: value
...
Is there a shortcut in validating fields in winforms? For example a particular textBox is required to be filled up before saving a record. What I always do is I check first all the required fields programatically before saving. Example:
protected bool CheckFields()
{
bool isOk = false;
if(textBox1.Text != String.Empty)
{
...
Hi,
Does setting PropertyGrid.SelectedObject = null; effects the actual object?
eg:
Button b = new Button();
System.Windows.Forms.PropertyGrid pg = new System.Windows.Forms.PropertyGrid();
pg.SelectedObject = b;
pg.SelectedObject = null;
What will happen to Button b? will it be null?
Thanks & regards,
Vishal.
...
Hello everybody!
I have the next problem:
TabControl has three TabPages. Every TabPage has its own DataGridView. On "Enter" event some rows change their background color.
When the form begin to initialize, the function, that changes color, is called. But DataGridView rows have their default background (background color hasn't been chan...
I want to insert a picture into a RichTextBox. I add the picture in coding.
This is the major code, adding a jpg image:
MemoryStream memoryStream = new MemoryStream();
img.Save(memoryStream,System.Drawing.Imaging.ImageFormat.Jpeg);
byte[] bytes = memoryStream.ToArray();
String width = img.Width.ToString();
String height = img.Height.To...
How do I repesent a single item in a list box in a foreach statement?
I have tried ListBoxItem but System.Windows.Controls is not considered a valid namespace in my .Net framework (version 4).
foreach(ListBoxItem item in listBoxObject.Items)
{
...
}
...
I'm writing a C# (ActiveX) plugin for an application that uses SetCompatibleTextRenderingDefault(true) (forces .net 1.1 text rendering style) This setting mangles some of the text I output with Graphics.DrawString() causing it to look slightly smudged and bolded. Unlike individual controls neither the Graphics class nor the BitMap don't...
This one is sort of esoteric. I ran into a NullReferenceException while trying to open a form (in the winforms designer) in a winforms project in visual studio 2008. The stack trace points to the fourth line of the following code:
public static class Logger
{
public static void LogMethodEnter()
{
var frame = new StackFr...
I need to populate a list that has 3 columns.
First: Icon Image.
Second: A string.
Third: A string.
I started to wire up a DataGridView and it seem awfully large and powerful for my needs. I am not interested in displaying data in a grid similar to a spreadsheet and I do not require all the functionality that comes with this control. I...
Hi,
Please let me know how do I run the app under current logged in user from the service.
To give you background, I have a VB.NET Windows service whose sole functionality is to run a Winform App at a specified time. Apart from that it also sets a system wakeup timer so that the system can be woken up at the specified time, if it goes ...
I thought it would be easy to find, I was wrong.
Dialog Requirements:
Can browse MULTIPLE FILES/FOLDERS in the same time.
Can be used in .NET windows forms.
FREE or can be used under GPL.
Works in Win Xp and Win 7.
Dialog Preferences:
C#
Looks like OpenFileDialog in .NET.
Has textbox for pasting path.
I have tried few examples f...
How do I obtain the values (not displayed text) of all the selected items in a List Box?
My intention is to use the values (which represent primary and foreign keys in my databases) to assemble a sql query.
Specs: Using WinForm with a .Net Framework v.4
...
I have a series of checkboxes on a form. One or more must be checked, and if not I want to display an error icon on them until one of them is.
My IDataErrorInfo implementation looks like so:
public string this[string columnName]
{
get
{
switch (columnName)
{
case "option1":
case "option2"...
I have an XML file full of this:
<machine id="">
<application id="">
<fichier name=""/>
<fichier name=""/>
<fichier name=""/>
</application>
<application id="">
<fichier name=""/>
<fichier name=""/>
<fichier name=""/>
</application>
</machine>
I know the id of machine and application and the name of fichi...