WinForms: Load localized help (chm) files

What is the best way to load a locale-specific (i.e. translated) compiled help file (.chm)? Our install will deploy them alongside the satellite assemblies containing resources. I'd like to re-use the same probing rules the .NET framework uses to load the satellite assemblies, and I'd definitely like to avoid writing my own searching algorithm, because for example, I'd have to handle specific cases such as "zh-CN/zh-Hans/zh-CHS". I can't find anything with the System.Windows.Forms.Help class th

how to do click and drag in a winforms application

I have a simple winforms application with a number of controls in it. I want to be able to click and drag from anywhere on the form and move the whole set of stuff around (panning). I have figured out the respositioning bit already. What I still need to figure out is how to tie the click and drag into updating my offsets. What I have tried so far is adding stuff to the main form's MouseDown, MouseUp and MouseMove events (sort of looks something like what this guy shows) , but they aren't gettin

Winforms Self hosted WCF not reachable

Hi guys I just want a simple WinForm app with one button. When I press the button i want to start the selfhosted WCF service. I want to able to connect to this service with for example another client app (winforms) by just adding a service reference. However the solution that I created is not working. I can't get connected with adding a service reference to this service. I don't actually know what address to call than except the address that I defined in the app.config file. Any help would be g

what is the best free/open source WinForms "progress bar" control?

what is the best free/open source WinForms "progress bar" control? (i.e. want a better looking control than the default one in VS2008, and one that has a nice continuous bar) PS I'm pretty new to .net so I'm not sure at all if there are any popular control libraries (open source) that are widely used or not...

Winforms Click once Deployment suddenly does not work. Displays windows login?

I am facing a peculiar issue. We use click once deployment for our windows application. It was working fine till last week. I made some changes to the application (just code nothing changed in properties) and suddenly I cannot publish anymore. When we give publish now it displays windows authentication dialog and when we provide the credentials nothing happens. It tries to connect to remote server (local LAN) and shows the dialog again. Any idea why this happens? Thanks for your help.

Winforms Disable digit substitution

How can I disable the digit substitution (for example for Hindi numerals instead of Arabic ones) for my application (native c++) completely? I want all the numbers displayed with 0123 instead of ٠١٢٣ There is an option in localization options in windows, but I don't want to change that for the user. Only for my app. Thank you!

Winforms Problem with casting activeX object onto my object

I'm trying to use Windows From as ActiveX control inside SAP B1. Inside that control I host WPF control. It works great except when I try to cast activeX object onto my class so I can use all the methods on my class. But when I try to do that I get an exception. What is wrong? I did registration and all that stuff. I can even display that control inside SAP with some handcrafted data (initialized in control constructor). Although I'm not sure if this is more general problem and not SAP-specific

Winforms Type of .NET control after custom based serialization?

In the process of serializing .NET control objects to custom objects (i.e. MyControlObject) to another process for some purpose, I need to re-draw these controls in a custom manner. I need to know what type it is (button, textbox, combo box, TextField, Calander, ToolStrip, TtoolstripMenu, RichTextBox, TabControl or TreeView). I might need a sort of typeOf(RichTextBox) == RichTextBox to check.

Winforms Visual C# Combobox

Is it possible if I choose 2 in my numericupdown control I will also have 2 comboboxes?? It's that the comboboxes that will appear will vary from the value of my numericupdown button. Or Maybe I'm thinking if i input 5 in my numeric updown I will have the choose 5 datas in my combobox and my choices will be stored in a listbox. Because I'm making a room assignment. for example a customer wishes to rent 5 rooms I should assign him with 5 available rooms. And I want my rooms assignment to be re

Winforms Why is the ListView with an ImageList very slow? (re: 1000+ thumbnails)

I'm trying to use a ListView component to show around 1,000 image thumbnails and I'm having some performance problems. First I create an ImageList containing my 1,000 images. This is lightning fast and takes under a second. However, once I assign the ImageList to my ListView, it takes around 10+ seconds. Example: ImageList _imgList = GetMyImageList(); // takes under 1 second ListView _lstView = new ListView(); lstView.LargeImageList = _imgList; // takes 10+ seconds Is there anything I ca

Winforms My DevExpress GridControl scrollbar won't scroll?

I have a DevExpress GridControl on a WinForms app that has a lot of columns in it. My horizontal scrollbar is shown on the GridControl. But, when I expand one of my columns, instead of scrolling horizontally, it just shrinks another column in the same GridControl! It's nutty! Does anybody have any ideas?

Winforms MEF and loading EntityTypeConfiguration in runtime

You cannot vote on your own post 0 Hi. I am developing this (http://arg-co.com/SabteNam%20-%20Copy.zip) windows application, and for my DAL I use Entity Framework. But every single extension has its own EntityTypeConfiguration, so I decided to use [Import] and [Export] to add them in OnModelCreating method of my DbContext.The problem here is that, in 'SabteNamDbContext' class which is located on 'SabteNamDataAccess' library, the '_Configs' is not initialized so I cant iterate it and add its

Winforms What's the simplest way to calculate a controls' inner display rectangle (with Padding subtracted)?

A control reports its display rectangle in .DisplayRectangle -- what is the simplest way of finding the area available for the control if .Padding is set? For example, a Label has .DisplayRectangle always equal to .ClientRectangle, even if .Padding is not (0,0,0,0). I want to obtain the size of the rectangle in .ClientRectangle after paying attention to the .Padding setting (and whatever additional properties might limit the "net" display area, for that matter). Isn't there some method, or oth

Winforms code-first Local no data loading

I have a generated SqlCe.4.0 Database by EntityFrameWork 4.3.1 code-first (updated nu-get package). System.Data.Entity.Database.SetInitializer is set via sampledata and database is generated correct, but when I attempt to read from database for displaying in DataGrid, no data is loaded. That means: In debug the DbSet.Local.Count is always Zero, but I can iterate DbSet items all are shown in debugconsole. What is wrong? Sincerely

Winforms Change Connection String in App.config at runtime

The code below serves to change connection string in App.config at runtime, I found it here but this code did not work for me on Visual Studio 2010 and SQL Server 2008, I could not open the connection to the Northwind database. using System; using System.Configuration; using System.Data; using System.Data.SqlClient; using System.Text; using System.Windows.Forms; using System.Xml; namespace MyNameSpace { public partial class FrmConnectionTest : Form { public FrmConnectionTest()

Sql connection error in winforms? Window Application?

In Microsoft Window application, i write connection code in app.config file, when i am accessing in winforms it is giving error please can you help me. private void btnInsert_Click(object sender, EventArgs e) { SqlConnection con = new SqlConnection(ConfigurationManager.AppSettings["mycon"]); cmd = new SqlCommand("USP_Insert_Students", con ); cmd.CommandType = CommandType.StoredProcedure; con.Open(); cmd.Parameters.AddWithValue("@Stname", txtStname.Text); cmd.

How to have a SharePoint action invoke a feature in a WinForms application launched by Click-Once?

We have a SharePoint site that our users have open all the time (type of dashboard for the business). We have a WinForms application that listens on a specific port for when the user clicks a web part on the SharePoint site, we take the JSON in the WinForms, parse the request and launch a feature in the WinForms. Essentially allowing a web site to launch a feature in a running WinForms app on the same client machine. This worked great when we were running in XP. When we moved to Windows 7 (w

Winforms Hide checkbox from filter in devexpress gridView (xtragrid)

I've a DevExpress XtraGrid control some columns and an unbounds column as boolean (so checkbox appears) for users to select the rows/items. I have applied filter as well. On column with checkBox in the filter row a checkbox appears at runtime. I don't want this checkbox to appear in filter row. How to do it?

Winforms Winform controls reset automatically

when I was changing background color of gridview. When I started my app for final tests the buttons were not working. I checked their on click code and it was correct. Then I double clicked the button it created new button onClick_1 method. All controls are now not pointing to the methods existing. They make new methods upon clicking.

Winforms What is default autoscrolling interval and step?

I'm writing custom tree control from scratch and I've yet implemented most of default behaviors of Windows control. My last change involved adding so called autoscroll feature: if you start making a rectangular selection and drag mouse below or above control, it starts to scroll automatically, such that you can select more elements than are currently visible. I would like my control to behave as similar to other Windows controls as possible, so my question is: is the automatic scroll interval a

Winforms Manage Tab Index in GridView

I have 3 columns in a gridview - code,Qty,name.If a cell(Say Code), is in edit mode, pressing the arrow or tab keys will fire the 'CellEndEdit' event and after that,moves the selection to the next cell. I want to have different selected cell if it is an arrow key and another selected if it is tab. eg: On Right arrow key: Code -> Qty On Tab press: Code -> Name The datagridview's key events(down,up,press) dont fire once the cell enters edit mode.So, how can i get the last pressed key's value when

Winforms Develop a User Guide help that can be opened from the Windows Application

I've almost completed a Windows Application (Windows Forms) project for a client, but one of his requests is to have the typical "?" menu item that opens an help file with a User Guide help. I know how to build documentation based on Documentation Xml (and I did that already), but this is something different: it must be a User Guide, something that the end-user will understand (he doesn't care to know anything about the code behind the application), with screenshots, HOPW-TOs, FAQ, etc. User m

Winforms A NullReferenceException exception in System.Windows.Forms.DataGridView

I have a .NET 4.0 WinForms application. A Form of the application contains a Grid – an System.Windows.Forms.DataGridView object Suddenly I have got a (non-reproducible!) NullReferenceException in it. The call stack was the following: System.NullReferenceException: Object reference not set to an instance of an object. at System.Windows.Forms.DataGridView.UnwireEditingControlEvents() at System.Windows.Forms.DataGridView.EndEdit(DataGridViewDataErrorContexts context, DataGridViewValidateCel

Create button handler in F# for WinForms app

I'm trying to make a very simple application in F#. I want just to make a tiny button with the click event, which will call the MessageBox.Show() method. open System open System.Windows.Forms module FSI = [<System.Runtime.InteropServices.DllImport("user32.dll")>] extern bool ShowWindow(nativeint hWnd, int flags) let HideConsole() = let proc = System.Diagnostics.Process.GetCurrentProcess() ShowWindow(proc.MainWindowHandle, 0) FSI.HideConsole() let form1 = ne

Winforms Adding a WinForm control to a Word Document using VSTO

I'd like to add labels to my Word document, specifically in the margin. I've seen that things like date pickers and combo boxes can be added to the document, but I can't see anything for what I'm after. I can get the ControlCollection object via: Globals.Factory.GetVstoObject(myApplication.ActiveDocument).Controls but there are no methods for adding labels. Are there any alternative methods for adding labels to a document using VSTO? [EDIT] So I managed to insert WinForm labels, however i

Winforms App Config - The Login is from an untrusted domain

First, I try to connect to sql server of other computer(PC1-PC\Instance1) through ssms with Windows Authentication but got this error Login failed. The login is from an untrusted domain and cannot be used with Windows authentication. I resolve the error when I edit the password of sa to 1234 in PC1-PC\Instance1. Then connect in the ssms with SQL Server Authentication. And successfully connected. The problem is in my Winforms app config, I set the connection to this: <connectionStrings>

Winforms Form, that is disabling parent window

In lot of programs, when you open up a new window form(let's call it "A-form"), it is disabling parent window form, so you cant do anything in that parent window, unles you close our A-form. Closest example is in WinRar program. When you open it, after a few second message shows up, called "buy licence". You cannot use WinRar, until you close that window. When click on main window, that "buy licence" form is blinking focused and unfocused, and main form stays blocked. I want achieve something li

Winforms Form.Load event doesn't fire

A form has been created. It can be seen, but 'Load' event doesn't fire. This is the simplest case: type Program() as this = let form_ = new Form(Visible=true, Text="Some Caption", Width=1024, Height=768) do form_.Load.Add(this.OnFormLoad) form_.Show() member x.OnFormLoad(e) = Trace.WriteLine("OnFormLoad() entering...") member x.form = form_ #if COMPILED [<STAThread()>] let program = new Program() Application.Run(program.form) #endif Where am I wr

Winforms chart axis arrows are oversized when exported to pdf from report viewer

I have this problem with the reportviewer pdf export. Everything is as simple as it can be, drag the chart run the report export to pdf you would expect it to work but it is not create a new rdlc file and add a chart and modify it to have axis arrows When viewed in report viewer everyhings fine Then i export this report to pdf but axis arrows are a bit oversized :) Any idea, help is appreciated, Thanks in advance

Winforms DevExpress VGridControl and CheckedComboBoxEdit - how to get checked values?

There is a strange behavior when using a ComboBox in VGridControl. I have a list of objects: var samples = new List<Samples>(); samples.Add(new Samples {Id = 1, Name = "s1"}); samples.Add(new Samples {Id = 2, Name = "s2"}); samples.Add(new Samples {Id = 3, Name = "s3"}); samples.Add(new Samples {Id = 4, Name = "s4"}); VGridControl has one row, and this row has a RowEdit = CheckedComboBoxEdit. CheckedComboBoxEdit.ShowDropDown is set to "DoubleClick". Then: repositoryItemCheckedComboB

Winforms .NET - Correct UI Structure

I'm working on a C# application's UI that has the following structure: Main Form (MDI Parent) Tree View Multiple MDI Childdren, each containing: Custom User Control I'd like to separate the form's canvas space allocated for the Tree View from that where the MDI Children are allowed to move in. To that extent, I tried a SplitContainer and setting the MDI Child's TopLevel field to 'false', but, besides the fact that newly created MDI Children were created behind the old ones, I also had iss

Winforms FSharpChart with Windows.Forms very slow for many points

I use code like the example below to do basic plotting of a list of values from F# Interactive. When plotting more points, the time taken to display increases dramatically. In the examples below, 10^4 points display in 4 seconds whereas 4.10^4 points take a patience-testing 53 seconds to display. Overall it's roughly as if the time to plot N points is in N^2. The result is that I'll probably add an interpolation layer in front of this code, but 1) I wonder if someone who knows the workings of

WinForms DataGridView set DataGridViewComboBoxCell value

I have a DataGridView with custom DataGridViewComboBoxCell columns, and I run the following code to initiaize it's cells to the initial value I want: try { this.dgvTemplatesConfiguration.Columns.Add(this.CreateFaultsColumn(faultsData, "OuterFaults", 2)); this.dgvTemplatesConfiguration.Columns.Add(this.CreateFaultsColumn(faultsData, "InnerFaults", 5)); } catch (Exception ex) { Log.WriteLi

Winforms C++ - save image from form to file

I'm new in programming Windows Form Application. I want to capture my Windows form (with the function CaptureScreen()) and save it to a file by clicking on a button using the SaveFileDialog. Here my code: private: System::Void CaptureScreen() { Drawing::Graphics^ myGraphics = this->CreateGraphics(); memoryImage = gcnew Drawing::Bitmap(Size.Width, Size.Height, myGraphics); Drawing::Graphics^ memoryGraphics = Drawing::Graphics::FromImage(memoryImage); memoryGraphics->CopyFr

Winforms Websocket for .NET Winform

Please provide me with a web socket client for .NET Winforms that is compatible with Web API and Microsoft.Websockets package. I have tried with System.Net.WebSockets, Websocket-sharp, and they are not working.

F# Winforms ChartArea: "How to add ArrowStyle to the Axes"

I am in the process of making a chart and i want to add the ArrowStyle to the axes. I have tried something like this: let chartArea = new ChartArea("Hello") chartArea.AxisX.ArrowStyle Nothing Erors but nothing happens either. I just get a regular chart. here is a reference to the ArrowStyle property can someone tell me how to add this ArrowStyle correctly to the ChartArea ?

Winforms Close ToolStripMenuItem when mouse leaves ToolStripMenuItems

I am new to windows Forms so I am wondering what the best approach to my problem is. I want the ToolStripMenuItems of the ToolStripDropDownMenu to close only when the user's mouse leaves the area containing them (All the ToolStripMenuItems) Currently I have the following code: { ToolStripDropDownMenu menu = new ToolStripDropDownMenu(); menu.AutoClose = true; foreach (ToolStripMenuItem toolStripItem in this.collectionToolStripMenuItems)

Winforms Return a list of all files from the selected Explorer Window with pywin32

I'm currently on Python 3 using the Win32 api. For window inspection, I'm using the Microsoft Inspect Tool. Currently, I have the following code that enumerates through all the windows: def getSelectedFile(): def callback(handle, hwnds): print(str(handle) + " - class name: " + win32gui.GetClassName(handle) + "-- name: " + win32gui.GetWindowText(handle)) return True hwnd = win32gui.GetForegroundWindow() if hwnd: if win32gui.GetClassName(hwnd) == 'CabinetWC

Winforms Outlook VSTO with new Office High DPI support

We have an Office VSTO add-in for Outlook written in C# and using Windows Forms. Before a recent Office update, the add-in was rendering just fine. But after Microsoft introduced Office support for high definition displays, many forms started to render blank in Outlook 2016 (MSO / Office 365). I can fix this inside Outlook by selecting "Optimize for compatibility" in Display Settings on the bottom status bar in Outlook: But this is not a tenable solution for our customers, if every user has

Winforms WInform DataGridView to Datetimepicker C#

I want to pass cell, which is date format in DataGridView to show in DateTimePicker. How would I do that? I set like below: **DateTimePicker: modifydtpPurchase / dgvAssetList: DataGridView. private void dgvAssetList_CellDoubleClick(object sender, DataGridViewCellEventArgs e) { PCId modifyAsset = new PCId(); modifyAsset.modifydtpPurchase.Value = this.dgvAssetList.CurrentRow.Cells[13].Value; modifyAsset.modifytxtSpec.Text = this.dgvAssetList.CurrentRow.Cells[14].Value

Winforms How to correctly call the case statments with switch by enum class in C++/CLI?

I did create an enum in order to choose between different options. In the last stage I get the choosen enum back. But something is wrong with my switch case expression. Enum: public enum class MyObjForm { Rechteck, Ellipse }; Die Klasse: public ref class Fenster2: public System::Windows::Form{ private: MyObjForm ^ form; double breite; double hoehe; Fenster2(MyObjForm ^ obj, double h, double b) : form{ obj }, hoehe { h }, breite{ b }

Winforms Powershell Forms - How to add context menu event handler to prevent open unless item selected?

I have a form with a listview for which I have a right click context menu. I'd like the menu to only appear if the right clikc is above the selected item in the listview - at the moment it appears anywhere in the listview windows and even if nothing is selected. Add-Type -AssemblyName System.Windows.Forms $form = New-Object System.Windows.Forms.Form $form.Text = "Foo" $form.Size = '400,400' $CMitemEnable = New-Object System.Windows.Forms.ToolStripMenuItem $CMitemEnable.Text = 'Enable' $CMitem

Winforms User-accessible folder for Click-Once applications

In a WinForms application written in C# and being deployed via Click-Once, if certain errors happen, I write information to a log file. I'm setting the path for that log file as such: private static string strAppPath = Path.GetDirectoryName(Application.ExecutablePath); private static readonly string strLogFile = "Log File.txt"; private static readonly string strPathToLogFile = strAppPath + "\\" + strLogFile; When an error happens, I am also showing a messagebox instructing the user to locate

  1    2   3   4   5   6  ... 下一页 最后一页 共 27 页