Answer Questions
Computer-Desk Object Styles -- System.Windows.Forms vs System.Web.UI.WebControls
System.Web.UI.WebControls.Button can load a style based on XAML. This can be done by using the Style method. I was wondering if there was a way to apply a XAML Style to a System.Windows.Forms.Button, since there is no Style method; I am unsure on how to do this. System.Windows.Forms.Button is based on Win32 controls which existed well before XAML. You question doesn't apply specifically to the C# language, moving from Visual C# Language to Windows Forms General forum. ...Show All
mcass Bootstrapper problems
Hello all, I've been trying to figure out this problem for a while... it should be extremely basic, but I've looked on the MSDN website and in a vb.net book, and still can't find the answer. I've download the .net bootstrapper, but i simply can't figure out (for the life of me) how to use it, or how to change application settings etc. How do i do this! Thanks so much! Sorry for such a dumb question -Robert Are you referring to the VS 2003 bootstrapper here http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnnetdep/html/vsredistdeploy1_1.asp VS 2005 has one built in. ...Show All
cracklestudios DoEvents in a Class Library
Hi, I have a VC# dll which has a while(true) loop. I was using a DoEvents in the original code, but now when I write the dll I cant use the DoEvents !! Is there a way to use DoEvents in a Class Library Thanks. Thanks a lot Andreas, I didnt realize I had marked the reply as an answer. And apologies to the rest of the people on the forum for my rudeness in my previous reply. I have two threads, one for sending and the other for receiving the data. I call these threads from a function, and this function is called from my C++ code at the time of initialization. I tried using the System.Windows.Form in my C# Class Library, but after I enter "System." I dont see any "Windows" ...Show All
Meso X Namespace Error
In Vis Studio 2005, ASP.NET 3, C# because I had so many form classes in the project, I added a folder and began moving the form classes into the new folder (e:\Work\Asp\WinC\cbiz\Form\). If the form class contained a dataset, this error appeared: Error 2 'thomas.DataSet' is a 'namespace' but is used like a 'type' E:\Work\AspWinC\cbiz\Form\Invoice.cs 17 13 cbiz In the sample snippet below, line 14 was causing this error. Line 15 is a fix, but it makes no sense to me. It seems like line # 4 should cover this. What is the 'real' problem and fix 1 using System; 2 using System.Collections.Generic; 3 using System.ComponentModel; 4 using System.Data; 5 using System.Drawing; 6 using System.Text; 7 using System.Windows.Forms; 8 using System ...Show All
CaptainSmudge Toolbar Button Images Not Appearing in Run Mode
I'm building a simple C# WinForms app that has a toolbar at the top. I've made each of the buttons fairly large: 130 x 32 so that I can include text and an image. The images are being drawn from an ImageList control In Design mode everything looks perfect, but when I run it the images disappear from the buttons! Any ideas why this is happening Robert W. Vancouver, BC Hi Roger, I finally solved the problem by deleting the toolbar and replacing it. But it took several iterations to do so. I now seem to have stable code with regard to this. But I have another frustrating problem: The VERY first time my code is run, the toolbar buttons don't work. Once the app is restarted this NEVER happens again. I think ...Show All
EWANAME Custom control for time editing
Hello. I need to implement a custom edit control for entering a time in the format: Hours:Minutes:Seconds where Hours can be 0-65535, Minutes and Seconds 0-59. I need a spin control (up down arrows) like in the standard DateTime control as well. I want using msctls_updown32 spin control, 2 static controls for displaying collons and 3 edit controls with custom key down handlers. I believe it is like the Windows has its own control implemented. My problem is that i failed to find how i can create a window/control by the class name. Please advise how i can do it. Thank you. Thank you, I will look at it. Are you using System.Windows.Forms to implement your control If not, post in the C++ General forum. Tricky. You are ...Show All
John Oliver (UK)MSP, VSIP Menu Titlebar
Hi I want to put in titlebar of my windows a menu, I am using Windows Forms C++. Can I put it This worked well for me: private const int WM_NCRBUTTONDOWN = 0x00A4; private const int HTCAPTION = 2; protected override void WndProc(ref Message m) { Console.WriteLine(m.ToString()); if (m.Msg == WM_NCRBUTTONDOWN && m.WParam.ToInt32() == HTCAPTION) { Point where = new Point(m.LParam.ToInt32() & 0xffff, m.LParam.ToInt32() >> 16); contextMenuStrip1.Show(this, this.PointToClient(where)); return; } base.WndProc(ref m); } You can draw a button to a the non-client part of the window which open up a context-menu, but I don't think it will allow you to over ...Show All
Kyle_W Compile warnings from adding merge modules
I have an installer that requires three merge modules (ATL, CRT, and MFC), and after adding them in, I get the following warnings when I build the MSI: WARNING: Two or more objects have the same target location ('[payload_ul]\8.0.50727.42.cat') WARNING: Two or more objects have the same target location ('[payload_ul]\8.0.50727.42.cat') WARNING: Two or more objects have the same target location ('[payload_ul]\8.0.50727.42.cat') WARNING: Two or more objects have the same target location ('[payload_ul]\8.0.50727.42.cat') WARNING: Two or more objects have the same target location ('[policydir]\8.0.50727.42.policy') WARNING: Two or more objects have the same target location ('[policydir]\8.0.50727.42.policy') WARNING: Two o ...Show All
Lovericky project publishing in visual studio
hello, I am in desparate need! I've writen a visual basic .net program that I can build/run locally, install/run after publishing to a file share but others cannot install or run (form bin directory). From project properties window: All references are copied local true, all namespaces are checked as imported, all images are set in a resource folder, prerequisites (.net framework 2.0 and windows installer 3.1) are downloaded from application location, .deploy extension is used (if it matters), and application files are include (auto). How can others run my program Please help, thank you. sorry for the wait, I had to modify some code for security reasons. You'll find it in your email. It will load, but may ...Show All
nithinraj ComponentAdding event: Cancel process of adding component
Hi everyone, I have a query regarding cancelling the IComponentChangeService.ComponentAdding event. I have an add-in that gets a reference to the IDesignerHost windows, and then hooks into the ComponentAdding event. Inside the ComponentAdding event I sometimes want to be able to cancel the adding of a particular component. According to the MSDN documentation "You can cancel the process of adding a component by throwing an exception here". If I throw an exception inside this event handler, although it does cancel the adding of the control, I get a messagebox in Visual Studio with stack trace info. Although Visual Studio does not close or crash due to this exception, I am wondering if it is possible to somehow cancel the adding ...Show All
Long Xue Remove ListItem from ListBox
Hi friends when i try to remove ListBox item(ListItem) its giving error error : List that this enumerator is bound to has been modified. An enumerator can only be used if the list does not change. i have only ListItem objects in my ListBox and my code as follows foreach ( ListItem removeitem in listBox1.SelectedItems) { listBox1.Items.Remove(removeitem); } and can anybody clear me the difference between ListBox and ListView and is ListItem only for ListView (or) can we add it to ListBox also any help pls, Regards Ranadheer. Thanks mobugz Regards Ranadheer You are not allowed to modify a collection when you are ite ...Show All
todd_bulky Master-Detail from Combobox to Datagrid
I am having hastles creating a master-detail relationship using a combobox and a datagrid. I have no problem creating the relationship, but when I test if the databound combo box filters the datagrid, or when I enter a new is entered with a selection in the combo box, it doesn't work. Any Ideas Is this what you are looking for using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.Data.SqlClient; using System.Globalization; namespace DataGrid { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form ...Show All
mzander binding datagrid column
I have a standard orders/orderdetails setup. The datagrids ItemID is set to a combobox which is populated with the product table data. What I want to do is somehow bind this so when a user selects an item from the combobox the correct price is shown in the datagrid price column. Thanks for the help. Hi,Cammyr You can do in this way, I write the following sample for your information: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WindowsApplication1 { public partial class Form22 : Form &n ...Show All
SParker Need help changing AxWebBrowser (COM) code to .NET Web Browser!
object obj = axWebBrowser1.GetOcx(); IOleObject oc = obj as IOleObject; oc.SetClientSite(this); How can I make this code work with the .NET 2.0 Web Browser Control I have exactly the same problem. Please let me know if you figure it out. I'll also post here if I make it work. It works for me. Don't put the 3 lines in the new method, where webBrowser1.ActiveXInstance has not been instanced. Never mind - I figured it out - this is all part of a .NET Browser effort. Email if you want a copy of the latest beta - mateuszrajca{at}gmail.com ~Matt Doesnt work. oc.SetClientSite(this); seems t ...Show All
lord_8 User control-Design time support
i have created a user control and for this control one property is an object of a class named ControlProperties i have designed a form to accept certain values( essentily the controlproperty class object ) which are added to an hash list for design time support..my problem is i dont know how to assign perssist this object...i am getting this object during design time..but once i run this the object becomes null..i figured out that the object properties is not being included in the intialize compnent method.. here is what id did..to open the form during design time public class DesignSupport : UITypeEditor { public DesignSupport() { // // TODO: Add constructor logic here // } public o ...Show All
