Jason Bolstad's Q&A profile
Windows Forms Is it possible to use DataGridViewRowCollection.List.RemoveRange?
Is it possible to use DataGridViewRowCollection.List.RemoveRange instead of DataGridViewRowCollection.RemoveAt to improve performance I tried the following, but it did not work: class AlphaRowCollection : DataGridViewRowCollection { public AlphaRowCollection(DataGridView dataGridView) : base(dataGridView) { } public void RemoveRange(int index, int count) { List.RemoveRange(index, count); //this works fine: /* for (int i = 0; i < count; ++i) { RemoveAt(index); } */ } } Hi, There is a remark in the MSDN : The List unshares all the rows in the Da ...Show All
Smart Device Development Creating Single Insatance Application in SmartDevice Application
Hai, I have created DeviceApplication present under Visual C#\SmartDevice\Windows Mobile 5.0 Pocket PC.The out of this is an exe.I want to make this exe to have single insatnce i.e if one instance is running,if u click on that exe for multiple times it must not new instances,instead it must pop-up some message.I have developed the exe in .NET 2.0 version.I tried to do fix the problem using mutex,but it did not work.Another approach is to derive a class from the WindowsFormsApplicationBase class in the Microsoft.VisualBasic.ApplicationServices namespace and set IsSingleInstance property.Can anyone explain how to do this for Smart Device Application.I found that GetProcessByName ...Show All
Visual C# Getting the Startup folder for the currently active user.... from a service...
I’m trying to get the startupfolder for the active user… Normally I’d use Environment . GetFolderPath ( Environment . SpecialFolder . Startup ); But, since the program i need to do it from is logged in as the service account, this returns “”… Does anyone know a clever way to get the startupfolder for the currently logged in user Any hints on where to look Thanks, Eric- o Win9x/98/Me - C:\Windows\Start Menu\Programs\StartUp o WinNT/2K - C:\Winnt\Profiles\All Users\Start Menu\Programs\StartUp o WinXP - C:\Documents and Settings\All Users\Start Menu\Programs\Startup ...Show All
Game Technologies: DirectX, XNA, XACT, etc. Help - Running DirectX on visual Studio 2005
I'm new to using Visual studio and directx. i've installed visual studio 2005 and DirectX SDK october 2006. I've installed C:\Program Files\Microsoft DirectX SDK (October 2006)\Include and C:\Program Files\Microsoft DirectX SDK (October 2006)\Lib\x86 to the include and library directories respectively in the VC++ The problem is when i use for example the project/code on this website http://www.toymaker.info/Games/html/2d_scrolling.html Its a simple scrolling tutorial. I can get the project to build succesfully but when i try to compile there is no "output" nothing happens. Any help is much appreciated. Thanks ...Show All
Windows Forms Highlighting labels and controls within MDI application
I am developing a simple MDI application with two child forms with one serving as a front-end version and the second serving as a back-end version of a database. The childform serving as a user-friendly front-end of the database contains different labels and controls such as richtextboxes, combo boxes and simple text boxes that are data bound. The second childform contains a DataGridView control showing data as it is stored in the relational database. I am trying to implement a mechanism by which when a user opens the childform containing the datagridview control and click on a row, it would open up the other childform showing the front-end of the database and highlight (something like a yellow rectangle) over the label and control asso ...Show All
Visual Studio Slow loading Guidance Navigator
Has anyone run into an issue with a project taking for ever to load when using Guidance Packages (like Web Service Factory). I have a project that sites on the Guidance Navigator for ever (30+ minutes). I recreated the project and loaded in seconds ... then i went in and enabled the Web Services Factory (ASMX) & the DATA ACCESS the Guidance Navigator opens starts loading and never comes back. This issue is a killer ... any ideas on what to look for I ran into something very similar, and deleting my .suo file and letting VS regenerate it seemed to solve it. I was also getting unusual RecipeFramework failure errors at th same time, so these may not have been related. Worth a shot, though, perhaps ...Show All
Windows Forms print content of a panel
Hi For print current view of a panel I can draw the panel into a bitmap, then draw the bitmap onto the paper. Something like this: Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage Dim bmp As New Bitmap(Panel1.Width, Panel1.Height) Panel1.DrawToBitmap(bmp, New Rectangle(0, 0, Panel1.Width, Panel1.Height)) e.Graphics.DrawImage(bmp, 0, 0) End Sub But it print only one page which is current page. Now if I want to print the whole content of a panel, what should I do Best Regards, Elham Do you mean that the panel is too long to fit in one page so you want to be abl ...Show All
Visual C++ How to simultaneously trigger multiple threads?
I have 3 worker threads, each created and started in the following manner: HWND pThread = ::AfxBeginThread(ThreadProc,hWnd,THREAD_PRIORITY_NORMAL); within each of the 3 versions of ThreadProc, i placed a ::WaitForSingleObject(ACEventObject.m_hObject,INFINITE); Previously, i have defined a CEvent object as global just for testing purposes. I've tried calling the ACEventObject.SetEvent(), .PulseEvent() and .ResetEvent, but i found out that each call of SetEvent or PulseEvent only set off one thread at a time. Which means, i had to call the setevent() or setpulse() three times so that all three will run. Is there a way to set them off all at one, because i'm working on quite a time critical data acquisition application. Thank You. ...Show All
Windows Forms Where should I put the global variables?
Hi all, First step, I created a simple "Windows Form" Form1 project. There is Form1.h, and I have many functions like click(), paint(), buttom_down()...in it. How to pass the variables between these functions Should I use global variables or they are not recommanded For example: The program tries to get the screen size and pass into image display function I will have scr_width, scr_height, img_src_width, img_src_height, img_scr_width, img_scr_height, Bitmap^ img... What is the good way to set up them And the second step will be, I separate the buttoms and display area, should I use two Forms If so, how do I pass these variables between so many functions in two Forms Thanks! ...Show All
Visual C# Define attributes for a property
Hello! Does anybody know how do I define an attribute for a property Like this: public class Test { [myproperty's attribute - how to define it ] private string MyProperty; } After defining it, I should use it via Reflection. Will it be shown in Attributes collection of PropertyInfo class Thanks! You create a class derived from System.Attribute, add the AttributeUsage attribute to it and make sure it includes AttributeTargets.Property. Once you've applied the attribute it will indeed show up in PropertyInfo.Attributes. ...Show All
Windows Forms Using a C++ DLL in VB.Net 2.0
Hi Everyone I hope someone can help me - I'm sure I'm posting this in the wrong forum, but maybe someone can point me in the right direction. I'm writing a vb application in VB2005 and I need to make use of an API called rssqlapi.dll. I spoke to the company that wrote the API and they write everything in C++. They provide millions of document samples on using the API in C++. After spending days with their support team, they advised that I should use something called a COM Wrapper. I'm not a c++ programmer and don't have a clue how to make this work in vb. Any ideas Hi,Supperher0 Check this project . ...Show All
Visual Basic Moving between panes of a Split Window
I frequently need to split my editing window so that I can simultaneously view different sections of my code. Is there a keystroke shortcut to switch from one pane to the other, or some other way that's faster than having to grab the mouse and click in the other pane Thanks. Thanks. Not only did this answer my question, but it opened up a whole new world of other possibilities, now that I know where these are defined. Thanks again. ...Show All
Visual Studio Tools for Office Toolbar Appearance Issue with Word & WordMail
Hello, I have a custom toolbar that appears with word and Outlook (WordMail). Just after the installation using MSI, if I open the word the toolbar appears but without closing it If I open the outlook (compose mail in wordmail editor) the Toolbar disappear bydefault. How can I avoid the disappear so that when I open wordmail the toolbar should appears bydefault I m using managed Com component of Office 11 in VS2005 (C#.net). Thanks, -Harish This really seems to be a Word/WordMail question, not a VSTO question. You'll probably get a better response if you repost to the Word add-in forum: http://msdn.microsoft.com/newsgroups/default.aspx dg=microsoft.public.word.vba.addins&lang=en&cr=US ...Show All
Windows Forms Strange RectangleF behaviour
Hi, I'm experiencing seeing some rather odd behaviour with RectangleF in release mode. Consider the following unit test: [Test] public void RectTest() { RectangleF rect = new RectangleF(0.2f, 0.0f, 0.8, 0.0f); //RectangleF rect = new RectangleF(0.25f, 0.0f, 0.75f, 1.0f); if (rect.Right > 1.0f) throw new Exception("rect.Right > 1.0f"); } When I run this test with the first rectangle initialization, it throws an exception. However, with the second rectangle, it does not. More generally, it seems that for x=1/n, and width=1-(1/n), where n is odd, the exception is thrown, but when n is even, it isn't (that rule starts to break down around n=25). Note also that no exception is ever thrown in debu ...Show All
Visual Studio Tools for Office VSTO Excel add-in only working in development machine
Hi, I am creating a Excel 2007 VSTO COM Add-In using VSTO 2005 SE . It runs perfectly fine when I build it and run the in development computer having VS 2005 . However, when I try to install the setup.exe or .msi file for the same addin in the client machine or Virtual PC having the following installed: 1. VSTO Runtime - Shipped with VSTO 2005SE 2. Office 2007 3. .NET 2.0 Framework it does not seems to load . I have done : 1. caspol settings to make it Fully Trusted . 2. set vsto_suppressdisplayalert=0 and run excel.exe from cmd ......Same Results .... I get the following error " Not Loaded. A runtime error occurred during the loading of the COM Add-in." It has been over a week now that I am str ...Show All
