winforms

Is it absolutely safe to display a WPF window from a WinForms form?

I would like to display a WPF window from a windows forms application (.NET 3.5). This code seems to work without any problem in a sample project: public partial class WinFormsForm1 : Form { public WinFormsForm1() { InitializeComponent(); } private void button1_Click(object sender, EventArgs e) { WpfWindow1 w =...

Wait until Page loading finishes - Windows Form application

I navigate the webbrowser in my application with Private Sub wb_DocumentCompleted(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles wb.DocumentCompleted But I need to navigate to another page after Logging in to the website How can I wait the first page to be loaded fully then navi...

Is it possible to display a command window inside a windows form?

Instead of spawning a separate command window as a child window, is it possible to host a command console as a child control of a form? Example: ...

How to change the double click option in the Xtrascheduler

Hi, I am using devxpress xtra scheduler.In the xtrascheduler i disabled the default context menu and i created a new context menu and it is working.But the problem is when i double click on the scheduler the existing appointment form is opening..But i need to open the form that i have added.How it can be done>??please help me... ...

Winform ListViewItem Checked Status Toggle

I have a problem with race conditions with winforms. listViewCollections.ItemChecked += foo //Somewhere void foo(object sender, ItemCheckedEventArgs e) { if (e.Item.Checked == false) return; bool flag = bar( e.Item.Index); if (flag) { MessageBox.Show( ... ) e.Item.Checked = false;...

C# What is the best way to get the index of an object in a OrderedDictionary?

In my OrderedDictionary I want to replace an object. I saw that the OrderedDictionary has a method called Insert(). So, I thought when I get the index of the object I want to replace, I remove that object with RemoveAt() and then insert the new object with the Insert() method. But... I need to figure out what the index is of the object ...

RichTextBox color formatting without moving visible view

Let's say that I have a RichTextBox and its contents take up about 3 times the height compared to the visible height. There's no color formatting, I want to highlight keywords. If I use SelectionStart, SelectionLength and SelectionColor, then I have to set SelectionStart back to the caret's original position. If, for example, I'm lookin...

Binding DB2 (iSeries) DATE/TIME/TIMESTAMP columns to a WinForms DataGridView

I am trying to pull the contents of an AS/400 file back to a data-bound .NET WinForms DataGridView (VS 2010). The query itself is no problem, and I am able to bind everything using the DataSource property of the grid. Data comes back with no issues. The problem I am having is that all date/time fields come back as string literals, mak...

AutoCad XData vanishing issue...

I have a C# application that interfaces with AutoCad. It's job is to rip through all of the entities on a model and find the ones that apply to what we're doing by looking for the presence of specific XData tags. The problem is when the drafters move a block to any layer that is marked as "invisible" (i.e. turn layer off) then the xdata...

windows form combo box problem?

Hi guys, I am writing windows from application in that i am using combo box control. I have already inserted data in combo box. some properties i have sated for combo box are dropdownstyle= dropdown autocompletesource = Listitem autocompletemode= suggested append. now my problem is i would like to restrict user to enter only those val...

VB.net 2010 - IndexOutOfRange from datagridview when refreshing dataset

I have a datagridview on a form that is bound to a table in a dataset from another class. I use a data adapter to .Fill a table in that dataset and the grid displays the data fine. Works fine. On my form I have a textbox the user can type in that will will pass a parameter to the storedprocedure used to fill this table. So on startu...

The same HTML google adsense code gives different result when run through webbrowsercontrol !

I have this code that is supposed to generate HTML file for google AdSense then navigate through it using the WebBroswerControl in a windows forms application the weird thing is that it produces one link with totally no formatting when it is run through the application. However, if I double click directly on the produced file, it gives...

WinForm button keeps focus

I have a winform with several buttons, when I hit a button, it runs the Click Event Handler, and then the button keeps selected, so if then I hit the ENTER key in the keyboard, it will run the Click event handler for that button again. I guess this is the default behavior for a button (keeping it selected when its clicked) but I cant f...

How to prevent Datagridview CellValidating firing twice?

I am validating user input in the CellValidating event of a DataGridView control and when the user inputs an illegal value, I show a messagebox. The problem is that the CellValidating event fires twice and hence the messagebox appears twice. I tried experimenting with various things and it appears to happen only when the messagebox is ...

How to Create UI from different application domain?

Hi guys, I've been doing pluggable console application before but with no UI on it. A simple telnet implementation provides the way for application configuration but now I'm tasked to provide a UI for it. I've read a blog on how to accomplish my requirements but I can't follow it. Can anyone provide simple explanation and simple implem...

Why am I getting these errors in C#?

EDIT: I got rid of most of my errors. Thanks for your help. There's something wrong with my while loop (in my Form class), but basically, it tests to see who the winner of the "race" is in my application, and it also starts the application (Shark.Swim). Once it finds out who the winner is, it needs to get to the "payout" method in my B...

How to run a form with it's own message pump?

I've got an application where I need to open many forms which are heterogeneous to my own and run independently. My application then proceeds to block on long running operations (making those operations asynchronous is not possible). So I would like to run these forms on a separate thread with their own message pump. Any way to do that? ...

How do I hide/show items in a CheckedListBox?

I have an instance of System.Windows.Forms.CheckedListBox which displays a list of tick boxes and I have some other System.Windows.Forms objects in my application. I would like to, depending on what the user selects using the other System.Windows.Forms items, show or hide different items in the System.Windows.Form.CheckedListBox. How cou...

Setting format of date time picker dynamically in windows form

I want to set format of date to dd-mm-yyyy for control date time picker,i m able to create date time picker dynamically but can not set its format to dd-mm-yyyy plz do needful.... ...

Can we create a 1-D array of UserControl. ..?

hi, I just created a "Usercontrol" in WINFORMS- it just contains 1-Button with some style. And i need to use the same as array(10) and load it to a form. Ex: Dim myButton() As Button = New ucSpecialButton(dataset4Category(i).Tables(0).Rows.Count - 1) {} Here my usercontrol name is ucSpecialButton can we create a ONE-Dimensional Arr...