Search Results

Search found 3559 results on 143 pages for 'winforms interop'.

Page 46/143 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • C# TabPage.Controls.Add too long

    - by Toto
    Hi, At run time, I add one control to a tabpage and I notice that it takes 0.5 sec to do it. It's rather long and I would like to reduce this time. I tried Suspend/ResumeLayout but for only one action it's no relevant and do not improved anythng. Any ideas ? Thx

    Read the article

  • combo box dropdown position

    - by Mironline
    dear friends I have a maximum size form which has the combobox (docked in top-right) and the combobox width is set to 500 px. now , the dropdown appear out of the screen , I want to set he dropdown position to start from right side to left side; // I use the visual studio 2008 and C# language // // thank you ashish yadav thank you . -mironline

    Read the article

  • Custom Designers deserialize SplitContainer problem

    - by Hamid
    Hi I just using this link http://msdn.microsoft.com/en-us/magazine/cc163634.aspx for extent custom designer. I using BasicDesignerLoader type because need xml data for save in db. all thing work properly. I try add SplitContainer to form and then serialize form, it's ok, but when try deserialize it, items that contains in SplitContainer Panel, failed. after i check it see not implement ReadRefrence method (only wrote WriteReference method) How to implement it fast ? Note: After download sample from http://download.microsoft.com/download/f/2/7/f279e71e-efb0-4155-873d-5554a0608523/DesignerHosting.exe, you must add typeof(System.Windows.Forms.SplitContainer) to ToolboxXmlManager.cs(Line 13) in ToolBox project. Note2: Find (De)Serialize method in BasicHostLoader.cs at Loader Project Thanks in advanced

    Read the article

  • Scrolling textboxes programmatically using WndProc messages.

    - by Hannes Nel
    Hi, I'm trying to scroll a textbox using the form's WndProc method. The code I've come up with so far, after scouring the internet, looks like this: private void ScrollTextBox() { scrollMessage = Message.Create(TabContents.Handle, 0x00B6, new IntPtr(0x0003), new IntPtr(0x0000)); this.WndProc(ref scrollMessage); } where TabContents is a TextBox. For some reason, nothing happens when i call this method. I'd like to know why. I realise that i can accomplish the same with the MoveToCaret method, but I'm curious why this is not working.

    Read the article

  • Select newly added Row - DataGridView and BindingSource

    - by Ruben Trancoso
    I'm adding a new Row to a BindingSource that is Bound to a DataGridView source.AddNew(); After this, use BindingSource to get the newly added row is return the next row in the DataGridView when its sorted. ROW "A" ROW "B" <- myBindingSource.AddNew(); ROW "C" myBindingSource.Current gives ROW "C". (it became the selected row in the DataGridView) I need this because I want to update just the newly added row DataRowView drv = (DataRowView)myBindingSource.Current; myTableAdapter.Update(drv.Row); and not the entire table. myTableAdapter.Update(myDataSet.myTable); and also, I would like to have this newly added line selected in the DataGridView after insertion. is it possible in some way?

    Read the article

  • upload file from window application to Remote Web Server

    - by user208466
    string filePath = "C:\\test\\564.flv"; try { WebClient client = new WebClient(); NetworkCredential nc = new NetworkCredential(uName, password); Uri addy = new Uri("\\\\192.168.1.28\\Files\\test.flv"); client.Credentials = nc; byte[] arrReturn = client.UploadFile(addy, filePath); Console.WriteLine(arrReturn.ToString()); } catch (Exception ex) { Console.WriteLine(ex.Message); } i am get this error "The remote server returned an error: (405) Method Not Allowed." what should i doo ??

    Read the article

  • Show NotifyIcon Context Menu and Control Its Position?

    - by Shawn O'Hern
    I'm trying to show a context menu when I left-click a NotifyIcon. Just calling NotifyIcon.ContextMenuStrip.Show() doesn't work very well. A solution has been posted here before that calls a secret method using Reflection: Dim mi As System.Reflection.MethodInfo = GetType(NotifyIcon).GetMethod("ShowContextMenu", Reflection.BindingFlags.Instance Or Reflection.BindingFlags.NonPublic) mi.Invoke(Icon, Nothing) This works great, except that I also need to control where the menu is shown. I want to wait for the SystemInformation.DoubleClickTime to elapse between receiving the NotifyIcon.MouseUp event and displaying the menu, so that I can handle single-clicks and double-clicks separately. But invoking the ShowContextMenu method displays the menu at the current mouse position when ShowContextMenu is called, not when the icon was actually clicked. Which means that if the mouse moved during the DoubleClickTime, the menu will be displayed in a different part of the screen. So if I can control where the menu is shown, I can just save the mouse coordinates when I receive the MouseUp event, and then I can ensure that the menu is displayed near the icon. Is there a way to do this? Thanks in advance.

    Read the article

  • Get aspect ratio of a monitor

    - by Alexander Stalt
    I want to get aspect ratio of a monitor as two digits : width and height. For example 4 and 3, 5 and 4, 16 and 9. I wrote some code for that task. Maybe it is any easier way to do that ? For example, some library function =\ /// <summary> /// Aspect ratio. /// </summary> public struct AspectRatio { int _height; /// <summary> /// Height. /// </summary> public int Height { get { return _height; } } int _width; /// <summary> /// Width. /// </summary> public int Width { get { return _width; } } /// <summary> /// Ctor. /// </summary> /// <param name="height">Height of aspect ratio.</param> /// <param name="width">Width of aspect ratio.</param> public AspectRatio(int height, int width) { _height = height; _width = width; } } public sealed class Aux { /// <summary> /// Get aspect ratio. /// </summary> /// <returns>Aspect ratio.</returns> public static AspectRatio GetAspectRatio() { int deskHeight = Screen.PrimaryScreen.Bounds.Height; int deskWidth = Screen.PrimaryScreen.Bounds.Width; int gcd = GCD(deskWidth, deskHeight); return new AspectRatio(deskHeight / gcd, deskWidth / gcd); } /// <summary> /// Greatest Common Denominator (GCD). Euclidean algorithm. /// </summary> /// <param name="a">Width.</param> /// <param name="b">Height.</param> /// <returns>GCD.</returns> static int GCD(int a, int b) { return b == 0 ? a : GCD(b, a % b); } }

    Read the article

  • C# - Layout problem on Windows XP professional

    - by Rakib Hasan
    I am developing a C# application with .NET Framework 2.0. The problem is, that on my client's PC, the controls get expanded, layout changes (positions of the controls gets changed), sometimes buttons get missed entirely. It happens even on Forms with 2-3 TextBoxes, 2-3 Buttons and some Labels. I tried a lot of investigations. I tried to show a message in the form's resize event. But it doesn't get called. After digging a bit more, it seemed that in Designer.cs file even though ResumeLayout (false) is being called for the form, but this causes the the expansion/disposition of the controls. My Client is using Windows XP professional on his Dell laptop. He is able to reproduce the issue on other laptops with Windows XP professional. But not in other OSes (like Windows XP Home or Windows Vista). In my desktop with Windows XP professional, it is not reproducible. How can this issue be resolved?

    Read the article

  • DataGridView not showing Columns and Rows during runtime.

    - by Ankush
    I have created a windows form with two groupbox (GB1 and GB2). GB2 is set to BringToFront and Hide. GB2 have Datagridview dgv docked in panel. GB1 has a button which invoke GB2 groupbox and fill 5 datagridview rows to perform 5 operations. But is not visible during runtime. It display all columns and rows after all 5 operations were done. I want to show the user each row. I have tried below code but it did not work. GB1.Visible = false; GB1.Hide(); panel.BringToFront(); GB2.BringToFront(); GB2.Visible = true; panel.Select(); panel.Focus(); GB2.Select(); GB2.Show(); dgv.Refresh(); dgv.Select(); dgv.Focus(); Please help me.

    Read the article

  • Logging erros in SqlLite database from C# Windows Forms Application

    - by Ismail S
    I'm developing a win app in C# which communicates to a WCF Service. I want to log exceptions that are thrown on client to be logged in Sql Lite Database (Win app is using Sql Lite database for storing data locally). And then later it should be sent to the wcf service when required so that it can be useful for support/analysis/application improvement. I want a method which can be directly called in every catch block simply by LogHelper.Log(ex). I would like to know if anyone has done it through Enterprise library or used any good practice for such situation?

    Read the article

  • How to set column width of gridview with respective resolution

    - by Royson
    My gridview has 4 columns. In my machine it is displayed properly according to my code. but when i tried to run my app on another machines my column height gets increased and header text of two column displayed on two-line. Like: MyAllFolder Path It should be displayed on same line with changing width. How to dynamically change column width to set column header text in one line??

    Read the article

  • WYSIWYG editor for Windows forms

    - by Tired
    Does anyone know of a good WYSIWYG editor for Windows forms. If I use a rich textbox, I need to handle pasting events, bold buttons, fonts etc, which is a nightmare. I’m currently using the HTML control, suggested by many sites, but I have a large form, with many tabs. Since I have to load up to 8 HTML controls, loading the form takes too long. Any help?

    Read the article

  • MouseMove sensibility

    - by serhio
    I use MouseMove event to move objects(say labels). simple principle(schematic): OnMouseMove(e MouseEventArgs) deltaX = e.X - lastX foreach label in labels label.Location.X += deltaX lastX = e.X Now, when I have one label there is no problem. Once the labels number increase, I start to see the labels traces along the moving trajectory. Is there a way to prevent this kind of traces? tried label.Visible = false label.Location.X += deltaX label.Visible = true does not help.

    Read the article

  • Friend WithEvents in VB vs private in C#

    - by serhio
    Hello, friends Who knows, why in vb.net WinForm projects the designer by default use the Friend WithEvents attributes and in C# - private ones. By ex, in a form.designer. .cs private Label Label1; .vb Friend WithEvents Label1 as Label; For WithEvents is more or less clear(for using Handles, apparently). But why Friend in VB and private in C#... Thanks.

    Read the article

  • Redraw and flicker issues

    - by AngryHacker
    I have an Outlook style app. So basically I have a sidebar on the left and on the right I have a panel control (pnlMainBody) that hosts content. The content is typically a user control that I add to the panel when user clicks appropriate button in the side bar. The way I add the user control to the panel is as follows: // _pnlEmails is the User Control that I am adding to the panel _pnlEmails = new pnlEmails(); _pnlEmails.Dock = DockStyle.Fill; this.pnlMainBody.Controls.Add(_pnlEmails); Some of the user controls that I add to the main panel are quite complex UI-wise. So when this.pnlMainBody.Controls.Add(_pnlEmails); fires, I see the control appear on the screen, then it resizes itself to fill the body of the panel control. It's quite ugly actually, so I was wondering whether there is a way to not show the resizing until it's actually done resizing? I've tried setting the user control's .Visible to false. I've tried doing .SuspendLayout, all to no avail. Is there a way to do this so the screen transitions are smooth?

    Read the article

  • How to change which item is “outlined” in a ListBox without changing the selection?

    - by Timwi
    How do you change which item is “outlined” in a ListBox? See the following screenshot for clarification: Background: I want to have a standard multi-select listbox that works normally. Unfortunately, the Windows Forms ListBox (with SelectionMode.MultiExtended) is not fully functional. The missing functionality is that it doesn’t let you select a disjoint set of items by using Ctrl+Arrow keys and Ctrl+Space. (Try it in Windows Explorer to see how it’s supposed to work.) I am trying to subclass ListBox and add this missing functionality. To this end, I intend to respond to Ctrl+Arrow keys in the OnKeyDown protected method, but in order to do so, I need to be able to move the outline without changing the set of selected items. How do I do that?

    Read the article

  • HELP! WebClient.UploadFile() throws exception while uploading files to sharepoint

    - by Royson
    In my application i am uploading files to sharepoint 2007. I am using using (WebClient webClient = new WebClient()) { webClient.Credentials = new NetworkCredential(userName, password); webClient.Headers.Add("Content-Type", "application/x-vermeer-urlencoded"); webClient.Headers.Add("X-Vermeer-Content-Type", "application/x-vermeer-urlencoded"); String result = Encoding.UTF8.GetString(webClient.UploadData(webUrl + "/_vti_bin/_vti_aut/author.dll","POST", data.ToArray())); } the code is running successfully..but for some files it throws exception The underlying connection was closed: The connection was closed unexpectedly. at System.Net.WebClient.UploadDataInternal(Uri address, String method, Byte[] data, WebRequest& request) at System.Net.WebClient.UploadData(Uri address, String method, Byte[] data) at System.Net.WebClient.UploadData(String address, String method, Byte[] data) Any Ideas what I have done wrong? I am using VS-2008 2.0

    Read the article

  • Exception in MSAccess when adding datas with ' character

    - by Suryakavitha
    i am using windows forms application with MSAccess.... i got data from database table successfully but when i am trying to add data with (') character i got the exception that "OLEDB Exception: Syntax error(Missing Operator)inquery expression" ... Now how can i solve this problem? Plz tell me the solution of this problem.... all characters are accepted but apostrophe character only got error... Thanks in Advance

    Read the article

  • Changing a formwindows backcolor from a panel

    - by JPJedi
    I have a panel that is docked to the right side of a windows form. I set a color with a setting on the panel but I want to then update the main form (not the panel) backcolor to the new setting. But when I use me.backcolor = setting it changes the panels backcolor. This is also with VB.net windows forms with Visual Studios 2008 Thanks

    Read the article

  • How can maintain a SqlConnection open always

    - by Salvador
    How can maintain a SqlConnection (or using another component) open (connected) always during the execution of my .Net app? I need this because my app needs to detect using this commnad exec sp_who2 how many instances of my app are connected to mydatabase, to restrict the access (license control). example A) my app executed from location1 check the number of my apps connected to the sql server using exec sp_who2 if the number of my applications < MaxLicencesConnected then start my app and open a sqlconnection B) my app executed from location2 check the number of my apps connected to the sql server using exec sp_who2 if the number of my applications = MaxLicencesConnected then close my application sorry for my english. thanks in advance.

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >