Here's my code:
int ypos = 0;
public void X()
{
MovieItem NewMovie = new MovieItem();
NewMovie.SearchMovie(txtSearch.Text);
NewMovie.Location = new Point(0, ypos);
ypos += 196;
panel1.Controls.Add(NewMovie);
}
After running method X about 4,5 times, the 5th or 6th item added isn't added where it should instead it...
I have a ListView that contains items with four columns. The values in three of the columns are pretty much fixed (although editable via an item editing dialog), but the value in the fourth is an index, and I want it to be calculated on the fly.
I know that I could use an owner-draw list, but, unless I don't get the examples in MSDN, it...
I have a windows forms application that reads and updates an XML file with information which a windows service must act on.
This has been working on Windows Server 2003, XP and Vista (x32) for some time.
Now, when installed on Windows Server 2008 x64, strange things have started happening, thanks I assume to the User "VirtualStore" fol...
Hello, I am trying to write a method that loops and repeatedly calls other methods. There is a single place inside the loop that I need to pause and wait for a user to click one of several buttons on the GUI. I have done this with command line code before, but I'm not sure how to wait and check it any buttons have been clicked. If som...
I have a TableLayoutPanel where each cell contains a single panel. I would like to be able to directly access any one of the cells by row and column and do something to the panel in it. I cannot for the life of me figure out if I can access controls within a cell. It would be great if I could do something like:
Panel p = layoutPanel.Ce...
Hi,
At first I assume I do need writerlock here but Im not sure (not much experience with that) what if I dont use it.
On the server side, there are client classes for each connected client. Each class contains public list which every other class can write to. Client requests are processed via threadpool workitems.
class client
{
publ...
Getting DocumentSteam for html websites without using a Winforms WebBrowser control for parsing?
Is this possible? I would like to create some types like:
HtmlDocument doc = new HtmlDocument ("http://www.ms.com");
DocumentStream ds = doc.GetFullStream();
...
Also if possible, please post code.
...
I am trying to make SaveFileDialog and FileOpenDialog enforce an extension to the file name entered by the user. I've tried using the sample proposed in question 389070 but it does not work as intended:
var dialog = new SaveFileDialog())
dialog.AddExtension = true;
dialog.DefaultExt = "foo";
dialog.Filter = "Foo Document (*.foo)|*.foo"...
Hi,
I was wondering what is wrong and after searching here I found out it could be due to disabled balloons, but thats not my case.
I am using simple code, but it doesnt work. Thank you
NotifyIcon ntf = new NotifyIcon();
ntf.BalloonTipText="bla";
ntf.Visible=true;
ntf.ShowBalloonTip(3000);
...
I'd like to change the file name of the SaveFileDialog in the event handler attached to the FileOk event, in order to replace the file name typed in by the user with another file name in some cases, while keeping the dialog open:
var dialog = new SaveFileDialog();
...
dialog.FileOk +=
delegate (object sender, CancelEventArgs e)
...
On a regular basis I find myself writing little utility programs that use some loop which takes a while to process. Yet while the loop is going the form no longer refreshes so if you were to move the form, or move another window over it and off, the form would be blank until the loop finishes.
Now I know the correct way to deal with thi...
I added some controls to my form and changed Anchor property how I'd expect this to work, but when I resize the form at the runtime, the controls stay at the same place.
For example, I have two buttons in bottom right corner of a form - they are on the form, no containers or anything like that. Anchor = Bottom, Right. FormBorderStyle = ...
For instance, to make something blue I would go:
this.BackColor = Color.LightBlue;
How can I summon the Control color, the khaki one.
Thanks SO.
...
I have a WinForms app in a single project written in VB.Net 2003 (legacy code). There is a MainForm and a SecondaryForm that is run by the MainForm. When I run the app thru the MainForm, I can debug with no problem. However, if I just run the SecondaryForm, I get the debug error, "There is no source code available for the current loca...
Hi, have Googled and cannot find out how to make a ToolStripSeparator "draw" an horizontal line in a toolbar that is aligned vertical.
The separator is drawn vertically which makes it awful.
Eg.
* - item
*
*
| <- separator
*
*
when it should be
*
*
- <- separator
*
*
...
I am developing a GUI application in C# using the design mode in VS2008. Now that I am finished with the looks of the application I am ready to add some functionality to it.
What really confuses me though, is that VS2008 designer only uses the empty constructor. When developing applications in Java I normally pass around a model and con...
public class FontType
{
...
public String Name { get { return _name; } }
public String DisplayName { get { return _displayName; } }
public Font UseFont { get { return _font; } }
}
bindFontTypes.DataSource = availableFonts;
comboFontType.DataSource = bindFontTypes;
comboFontType.ValueMember = ...
I have a GUI with a flat style for the buttons. I would like to use TextBox controls with the same appearance, but I can't find where can I configure the outer line with. Is there any control in WinForms which can be given FlatStyle? Thanks!
Edit 1
Thanks for the information about FixedSingle border style, but then, how can I change ...
I'm getting a weird behavior with a datagrid. No matter what I do, it's ordering the columns arbitrarily and adding all the columns in the objects.
I'm using .NET 3.5, with a winforms datagrid. The Datasource is set at runtime, not design time. I've tried defining the columns in the GDI, but it ignores the order. Even if I only defi...
Hi,
When we place a component on a Windows Form, the default behavior for the designer is to serialize a contructor call in the IntializeComponent method of the form.
Is there any way to have a custom serializer output the following code:
if (componentInstance == null)
componentInstance = new componentClass();
instead of just:
c...