Search Results

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

Page 13/143 | < Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >

  • Using graphical ActiveX (COM) controls in WinForms project

    - by alex
    I have a collection (set) of ActiveX controls. I recieved them from our vendor company. I created a wrappers for them using tlbimp.exe and aximp.exe. All non-graphical controls work good. All graphical controls don't react on some methods. When I call their methods I get: TargetInvocativeException (InnerException is null). or Attempt to read/write protected memory. Our vendor company assure that their graphical activex controls work good. But they don't provide support service, so I have to find solution of my problem alone. And some more, All graphical activex controls don't react on mouseclick or any other mouse manipulations. But documentation says: it must change the color on mouse click. Maybe, someone have same symptoms and can help me ! I googled over that problem many pages but they don't help me. Maybe it's some Visual Studio settings or compiler options ? I use VS 2005.

    Read the article

  • Problem with persisting inteface collection at design time in winforms, .net

    - by Jules
    The easiest way to explain this problem is to show you some code: Public Interface IAmAnnoyed End Interface Public Class IAmAnnoyedCollection Inherits ObjectModel.Collection(Of IAmAnnoyed) End Class Public Class Anger Implements IAmAnnoyed End Class Public Class MyButton Inherits Button Private _Annoyance As IAmAnnoyedCollection <DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _ Public ReadOnly Property Annoyance() As IAmAnnoyedCollection Get Return _Annoyance End Get End Property Private _InternalAnger As Anger <DesignerSerializationVisibility(DesignerSerializationVisibility.Content)> _ Public ReadOnly Property InternalAnger() As Anger Get Return Me._InternalAnger End Get End Property Public Sub New() Me._Annoyance = New IAmAnnoyedCollection Me._InternalAnger = New Anger Me._Annoyance.Add(Me._InternalAnger) End Sub End Class And this is the code that the designer generates: Private Sub InitializeComponent() Dim Anger1 As Anger = New Anger Me.MyButton1 = New MyButton ' 'MyButton1 ' Me.MyButton1.Annoyance.Add(Anger1) // Should be: Me.MyButton1.Annoyance.Add(Me.MyButton1.InternalAnger) ' 'Form1 ' Me.Controls.Add(Me.MyButton1) End Sub I've added a comment to the above to show how the code should have been generated. Now, if I dispense with the interface and just have a collection of Anger, then it persists correctly. Any ideas?

    Read the article

  • Winforms / .Net - dynamically creating install .exe or script

    - by Serexx
    Hello -- Does anyone know how I can Dynamically create an installation package that installs files into a folder that is determined at installation-runtime, not by the user, but by obtaining the UserAppDataPath for that specific user on that specific PC. By dynamically I mean that I must create the installation package programatically as part of another process. Any help ideas greatly appreciated!

    Read the article

  • Winforms: How to speed up Invalidate()?

    - by Pedery
    I'm developing a retained mode drawing application in GDI+. The application can draw simple shapes to a canvas and perform basic editing. The math that does this is optimized to the last byte and is not an issue. I'm drawing on a panel that is using the built-in Controlstyles.DoubleBuffer. Now, my problem arises if I run my app maximized on a big monitor (HD in my case). If I try to draw a line from one corner of the (big) canvas to the diagonally oposite other, it will start to lag and the CPU goes high up. Each graphical object in my app has a boundingbox. Thus, when I invalidate the boundingbox of a line that goes from one corner of the maximized app to the oposite diagonal one, that boundingbox is virtually as big as the canvas. When a user is drawing a line, this invalidation of the boundingbox thus happens on the mousemove event, and there is a clear lag visible. This lag also exists if the line is the only object on the canvas. I've tried to optimize this in many ways. If I draw a shorter line, the CPU and the lag goes down. If I remove the Invalidate() and keep all other code, the app is quick. If I use a Region (that only spans the figure) to invalidate instead of the boundingbox, it is just as slow. If I split the boundingbox into a range of smaller boxes that lie back to back, thus reducing the invalidation area, no visible performance gain can be seen. Thus I'm at a loss here. How can I speed up the invalidation? On a side note, both Paint.Net and Mspaint suffers from the same shortcommings. Word and PowerPoint however, seem to be able to paint a line as described above with no lag and no CPU load at all. Thus it's possible to achieve the desired results, the question is how?

    Read the article

  • Windows Authentication for winforms with Windows 2000

    - by The King
    I use the following code to validate users through windows authentication for my winform application. This works fine with windows XP but when the user is using windows 2000, it says that the userid or password is in valid. How do I do this in Windows 2000. Further, How do I detect whether the user is using Windows Xp or windows 2000. [System.Runtime.InteropServices.DllImport("advapi32.dll")] public static extern bool LogonUser(string userName, string domainName, string password, int LogonType, int LogonProvider, ref IntPtr phToken); public bool IsValidateCredentials(string userName, string password, string domain) { IntPtr tokenHandler = IntPtr.Zero; bool isValid = LogonUser(userName, domain, password, 2, 0, ref tokenHandler); return isValid; } Thanks

    Read the article

  • WinForms: Control ListView checkbox painting

    - by Telanor
    It seems that the checkbox used in a ListView when CheckBoxes = true isn't a proper checkbox. It doesn't draw the MouseOver or MouseDown state and it doesn't support the Indeterminate/Intermediate state. How can I replace the checkbox with a standard checkbox control or take control of the drawing of just the checkbox so I can use the CheckBoxRenderer class?

    Read the article

  • WinForms Application Hangs

    - by Ram
    Hi, I have an application (ABC) that I developed and it as a windows application (.exe). It is by itself quite a big application referring a lot of dll's. However, now there is a requirement that demands that this application(ABC) be a part of an even larger application (XYZ). Hence, I had to change the project type of "ABC" from being a windows application to a class library, and by changing a few lines of code. My problem is that, ever since I started using ABC as part of XYZ, the application started hanging if I dint perform any operation on it for 10 to 15 mins... I do not have any problems while running it as a separate application. Any reasons why this might occur? Any suggestions would be really appreciated... Thanks, Ram

    Read the article

  • WinForms Form won't close on pressing X or Close() in C#

    - by MadBoy
    I'm having a bit weird problem with WinForm which seems to refuse to close for some weird reason. I've got very simple gui which sometimes doesn't react for me pressing X or when i use events on buttons it even reaches Close() and does nothing.. private void buttonZapisz_Click(object sender, EventArgs e) { string plik = textBoxDokumentDoZaladowania.Text; if (File.Exists(plik)) { string extension = Path.GetExtension(plik); string nazwaPliku = Path.GetFileName(plik); SqlMethods.databaseFilePut(plik, comboBoxTypDokumentu.Text, textBoxKomentarz.Text, sKlienciID, sPortfelID, extension, nazwaPliku); Close(); } } There are no events assigned to FormClosed or FormClosing. So how can I find out what's wrong. Sometimes X will work after the GUI is loaded but after i press Button to save some stuff to database it reaches Close() in that button event and it still is visible and does nothing. Can't use X, nor ALT+F4. I can go around GUI and choose other values for ComboBox without problem. I call GUI like this: private void contextMenuDokumentyDodaj_Click(object sender, EventArgs e) { var lv = (ListView) contextMenuDokumenty.SourceControl; string varPortfelID = Locale.ustalDaneListViewKolumny(listViewNumeryUmow, 0); string varKlienciID = Locale.ustalDaneListViewKolumny(listViewKlienci, 0); if (lv == listViewDokumentyPerKlient) { if (varKlienciID != "") { var dokumenty = new DocumentsGui(varKlienciID); dokumenty.Show(); dokumenty.FormClosed += varDocumentsGuiKlienci_FormClosed; } } else if (lv == listViewDokumentyPerPortfel) { if (varPortfelID != "" && varKlienciID != "") { var dokumenty = new DocumentsGui(varKlienciID, varPortfelID); dokumenty.Show(); dokumenty.FormClosed += varDocumentsGuiPortfele_FormClosed; } } } While I can't close GUI i can work on the main gui without problem too. I can open up same GUI and after opening new GUI i can quickly close it. GUI is very simple with few ComboBoxes,TextBoxes and one EditButton from Devexpress. Edit: varDocumentsGuiPortfele_FormClosed code allows me to refresh GUI (reload ListView's depending on where the user is on now). private void varDocumentsGuiPortfele_FormClosed(object sender, FormClosedEventArgs e) { TabControl varTabControl = tabControlKlientPortfele; if (varTabControl.TabPages.IndexOf(tabPageDokumentyPerKlient) == varTabControl.SelectedIndex) { loadTabControlKlientPortfeleBezZmianyUmowy(); } }

    Read the article

  • C# - Winforms webBrowser

    - by user335932
    How can i pass the URL property in web browser into an if statement.... private void button2_Click(object sender, EventArgs e) { var GameStats = comboBox1.Text; if (GameStats == "BattleField: Bad Company 2") { //Make URL equal to http://statsverse.com/ } }

    Read the article

  • WinForms: finding the size of a minimized form without going to FormWindowState.Normal

    - by Doc Brown
    Is there an easy way to determine the size of a Form it does have in WindowState=Normal, without actually changing the Form state? Here is what I do now (C# code): public class MyForm: Form { public void MyMethod() { // ... FormWindowState oldState = this.WindowState; this.WindowState = FormWindowState.Normal; Point windowLocation = this.Location; Size windowSize = this.Size; this.WindowState = oldState; // ... } } This is what I would like the code to look like: public class MyForm: Form { public void MyMethod() { // no state change here Point windowLocation = this.NormalStateLocation; Size windowSize = this.NormalStateSize; } } In fact there are no NormalStateLocation or NormalStateSize properties in Windows Forms.

    Read the article

  • .NET Thread Pool - Unresponsive WinForms UI

    - by Goober
    Scenario I have a Windows Forms Application. Inside the main form there is a loop that iterates around 3000 times, Creating a new instance of a class on a new thread to perform some calculations. Bearing in mind that this setup uses a Thread Pool, the UI does stay responsive when there are only around 100 iterations of this loop (100 Assets to process). But as soon as this number begins to increase heavily, the UI locks up into eggtimer mode and the thus the log that is writing out to the listbox on the form becomes unreadable. Question Am I right in thinking that the best way around this is to use a Background Worker? And is the UI locking up because even though I'm using lots of different threads (for speed), the UI itself is not on its own separate thread? Suggested Implementations greatly appreciated.

    Read the article

  • Draw a rectangle using Winforms

    - by C. Karunarathne
    Can I draw a rectangle with mouseClick?My code is not working so far.Can you help me? private void panel1_MouseClick(object sender, MouseEventArgs e) { Graphics g = this.CreateGraphics(); Pen pen = new Pen(Color.Black, 2); g.DrawRectangle(pen, 100,100, 100, 200); }

    Read the article

  • Horizontal scroll winforms listview

    - by tempy
    Anyone know if its possible to enable horizontal scrolling ONLY in a windows forms listview (viewmode set to large icons). What I want to do is make a listview whose height is sufficient to only show one row of icons, and I don't want to have multiple rows. Just one very long row that a user would have to scroll horizontally to get to out-of-range icons. If I make the listview scrollable then it automatically makes multiple rows and puts in a vertical scrollbar, which I don't want. Thanks in advance!

    Read the article

  • How to detect when window is closed when using Show() in WinForms C#

    - by MadBoy
    I've been using ShowDialog() in following way for all my new Windows. SomeGui test = new SomeGui(); test.ShowDialog(); refreshSomeListView(); However recently I've started to use Show() instead of ShowDialog() and it's working much better. The only drawback of this is that refreshSomeListView(); cannot be used like in example above since if i leave it there it's executed instantly when new Window shows up. What's the best way to know that the user has closed test window and that now refreshSomeListView(); should be executed? What's suggested approach for this? Should it involve setting events in test GUI on Close/Closing or there's other / better method?

    Read the article

  • Winforms Hotkey, Help?

    - by Di4g0n4leye
    namespace WebBrowser { public partial class MainForm : Form { public MainForm() { InitializeComponent(); } int GetPixel(int x, int y) { Bitmap bmp = new Bitmap(1, 1, PixelFormat.Format32bppPArgb); Graphics grp = Graphics.FromImage(bmp); grp.CopyFromScreen(new Point(x,y), Point.Empty, new Size(1,1)); grp.Save(); return bmp.GetPixel(0, 0).ToArgb(); } void Button1Click(object sender, EventArgs e) { int x = Cursor.Position.X; int y = Cursor.Position.Y; int pixel = GetPixel(x,y); textBox1.Text = pixel.ToString(); } void MainFormLoad(object sender, EventArgs e) { webBrowser1.Navigate("http://google.com"); } } } } i want to add a hotkey that call Button1 on Press, How can that be done?

    Read the article

  • Provide "Paste Link" Functionality in C# Winforms App

    - by Tim
    I would like to add Copy-Paste Link functionality to an application. The application replaces a complex Excel workbook. I would like to be able to copy tables, text, and charts from the application and use Paste Link in MS Word. For the uninitiated: With Excel, when you use Paste Link for the tables, text, charts, etc. the items update in Word when you change them in Excel. Does anyone know for sure if this is/is not possible (is it some proprietary feature of MS Word-Excel)? If not, can anyone point me to some resources that will help (either an app that does this or a tutorial/write-up). Thanks!

    Read the article

  • Test Application Guide for Winforms

    - by Jonathan
    I'm a c# developer in a medium/small company. I use to do quick test of the apps that my workmates made and they use to test my applications. We test each form based in our experience. (yes, I know this is not a very formal method) Now a new guy without experience are going to join our team. We think now is the momento to make a little list of things that all we should test in each form. Divided by categories. For example usability: Test that the taborder of each control are properly setted, or Valitacion: Test that the max lenght of each textbox match with the max lenght of a field in the DB...etc We don't one to Reinvent the Wheels, so I want to know if such kind of document already exists. Thanks

    Read the article

  • Question about WinForms TrackBar control in .Net

    - by Jules
    Does anyone know the millisecond interval, used by the framework trackbar, between calling the ValueChanged event when moving the grip with a mouse? I've implemented my own trackbar and I'd like the behaviour to be consistent with what the user expects. I've had a look in reflector but it's one of those controls where most of the implementation is not viewable. ETA: Actually, thinking about it, it's not as simple as that. For small changes, the TrackBar is raising the event for every change. However, if you make a large fast change with the grip, it will not raise the event for every step. Just wondering exactly how the framework does this? Thanks

    Read the article

  • C# Winforms: How to display a loading form?

    - by Martijn
    I have a grid and when a row is double clicked a form is loaded. However a lot of data must be loaded, so I'd like to display a simple form with the text 'loading, please wait..'. And when all loading is finished, the form must disappear. This is what I have right now, but it doesn't work: Code that invokes the form with lots of data: FormWithLotData form = new FormWithLotData(); form.ShowDialog(this); Constructor of FormWithLotData: // Show load form FormIsLoading frm = new FormIsLoading(); _CloseLoadForm closeForm = new _CloseLoadForm(frm.Close); System.Threading.Thread thread = new System.Threading.Thread(frm.Show); thread.Start(); InitializeComponent(); this.Visible = false; LoadAllData(); this.Visible = true; // Close load form Invoke(closeForm); Hope you can help me out.

    Read the article

  • Generating a second context menu dynamically in Winforms

    - by rsteckly
    Hi, I have a context menu with a few selections. If the user picks a particular choice, I want a list of choices in a second menu to come up. These choices would be coming from a data store and be unique to that user. I see how in designer you can add a set of choices statically that show upon the user making a selection. However, what do you do when you need that to come from data and not design it in the designer?

    Read the article

  • C# WinForms StatusStrip - How do I reclaim the space from the "Grip"

    - by Clyde
    I've got a StatusStrip with a single ToolStripStatusLabel, Spring=true and a background color for notifications. The problem is that there's an ugly gray square on the right side of the status strip. After fiddling for a while, I realized this is the sizing grip (I had is set to SizingGrip=false, GripStyle=Hidden). Yet even with it hidden, it still hogs the space. I can't get any content on the status strip to extend all the way to the right. How would you work around this? Note I can't just set the backcolor of the StatusStrip because the Status Label changes colors and has some fading effects.

    Read the article

  • Winforms application hangs when switching to another app

    - by joseluisrod
    Hi, I believe I have a potential threading issue. I have a user control that contains the following code: private void btnVerify_Click(object sender, EventArgs e) { if (!backgroundWorkerVerify.IsBusy) { backgroundWorkerVerify.RunWorkerAsync(); } } private void backgroundWorkerVerify_DoWork(object sender, System.ComponentModel.DoWorkEventArgs e) { VerifyAppointments(); } private void backgroundWorkerVerify_RunWorkerCompleted(object sender, System.ComponentModel.RunWorkerCompletedEventArgs e) { MessageBox.Show("Information was Verified.", "Verify", MessageBoxButtons.OK, MessageBoxIcon.Information); CloseEvent(); } vanilla code. but the issue I have is that when the application is running and the users tabs to another application when they return to mine the application is hung, they get a blank screen and they have to kill it. This started when I put the threading code. Could I have some rogue threads out there? what is the best way to zero in a threading problem? The issue can't be recreated on my machine...I know I must be missing something on how to dispose of a backgroundworker properly. Any thoughts are appreciated, Thanks, Jose

    Read the article

< Previous Page | 9 10 11 12 13 14 15 16 17 18 19 20  | Next Page >