Answer Questions
vasudupe Navigators addnewitem
hi, i am adding a bindingnavigator at run time. now the addnewitem will run twice , i would set it to none before and it wud work, but programmatically i do not see it working. i need to prevent the standard click method of the addnewbutton to occur, and instead this one here shud run. thanks NvNavigator.Dock = DockStyle .Top; NvNavigator.AddStandardItems(); NvNavigator.AddNewItem = null ; NvNavigator.Items.AddRange( new ToolStripButton [] { TSBSave, TSBRefresh }); NvNavigator.AddNewItem.Click += new EventHandler (AddNewItem_Click); Controls.Add(NvNavigator); } void AddNewItem_Click( object sender, EventArgs e) { if (NvNavigator.BindingSource != null ) { try { NvNaviga ...Show All
Toni Greco how do you suppress code from running in design mode?
hi, i have a valid peice of code that gets executed in a load() event for a C# form when the app is executed. the trouble is, in design mode it is not valid so when i try to open the form to edit it i get the ugly pink banner error message. here is what i did to suppress this: if (AppDomain.CurrentDomain.FriendlyName != "DefaultDomain") { //design time offending code... } is this the correct thing to do thanks, scott If this code is being called from a control or other windows object... check its DesignMode property to determine if it is running in the IDE. hi thanks brenden, i only went to get a cup of coffee and your reply was there. too fast. scott ...Show All
FRENFR IE7 Tabs Control
Hi everyone, I was wondering if someone has made a custom control of the IE7 tabs. I would like to use them in a project. Best wishes, Tobias Hi, please post your question in the following newsgroup. http://www.microsoft.com/communities/newsgroups/list/en-us/default.aspx query=custom+toolbars+for+IE&dg=microsoft.public.internetexplorer.general&cat=en_us_28cca3eb-7037-4d4f-bde1-d8efee1f1420&lang=en&cr=us&pt=&catlist=&dglist=&ptlist=&exp=&sloc=en-us thank you, bhanu. ...Show All
PerPixel Additional Infos: PropertyGrid: How to catch an exception?
I use a PropertyGrid to show a business object in my application. The business object throws exceptions if the user tries to enter an invalid string inside the PropertyGrid. The PropertyGrid shows two different behaviors in this case: If a default TypeConverter is used the PropertyGrid shows an builtin error message dialog. If a custom TypeConverter is used the PropertyGrid doesn't handle the exception. This happens only in Debug mode. How can I catch these exceptions and suppress the builtin error message dialog of the PropertyGrid I used the IServiceProvider/IUIService method to show a custom error dialog to the user in a PropertyGrid in .NET 2.0. Below you will find a generic example ...Show All
Mark Asztalos Want to set initialdirectory to the mycomputer
Hi All, I am using openfiledialog and savefiledialog in windows form. I want to set its initial directory to "my computer". I have tried Environment.GetFolderPath(Environment.SpecialFolder.MyComputer) but it's not working. Anybody please help me in this..... Yes that's true. But if you have seen folderbrowser shows mycomputer and we can set initialdirecotry as mycomputer. we have to set its rootfolder.Can anybody please tell me whether it's possible or not Check this thread for the answer. its not a bug, its by design. There is no "path" to my computer. Therefore it will redirect to my documents for example. May be you can do some research in the f ...Show All
Vijay_kar Custom Control
How would I go about creating a custom control What do I create in the Designer How can I change the button Can I add colors, properties, etc Create a new project in your solution and choose Class Library Do this: File > New > Project and choose: Windows Control Library You should have a gray square in the designer window. Click on it. In the panel on your right is the properties where you choose all the options you want. This creates a .dll that you can add to all your projects so they all have that button's properties. If you are already in a project and want to create a custom control for that project only, in that same panel on your right but on top this time, there should b ...Show All
Gravy Two blank error dialogs running setup.exe
On running the setup.exe from my clickonce deployed application I am getting two blank error dialogs immediately. However, double-clicking the .application file runs my application with no problems. Does anyone know how to fix this Quite a few of our developers are experiencing this problem. Can you see if there's an installation log Go to the temp directory and look for the newest folder named VSD*. In that folder should be install.log... can you post that There is nothing in the temp directory. I don't think it gets as far as starting the installation. Well, what settings are going into building the bootstrapper I'm wondering if maybe you have the wrong ...Show All
arro239 Re-defining events on custom controls?
Hi. I am making a custom control, that should respond to mouse related events. Is it possible to make the controls Click, MouseDown etc. event handlers to accept different parameters than usually I'll show you what I would like to achieve: //this would be in in the form, where the custom control is to be added //the Click event handler for my custom control private void myCustomControl_Click(object sender, MyCustomEventArgs e ) { //handling, here I could use the information the control provided via MyCustomEventArgs } So, when I drag and drop my custom control on the form in visual studio, and double click the ontrol, I would get the event handler like the previous. I have tried to search, but had no answer. Is it easier just do event wi ...Show All
DSent Complex Binding and BindingComplete Events.
I am binding some objects to various controls. Some are bound to textboxes using simple binding. Others are bound to a datagrid using complex binding. All bindings are done via a binding source. In the case of simple bindings, the text property is bound to a property on the object. In the case of complex binding the datagrid's datasource property is set to the binding source. I am using the bindingcomplete event to create a multi-step undo operation (control z). This works great when listening to the bindingcomplete event on the binding source when it is used against simple bindings. Complex bindings, however, do not seem to raise this event. Is there a way to catch data source updates from a complex bound bindingsource Thanks, Jason ...Show All
Helen999888 design question - re dynamically creating controls
I have to create an interface (vb.net 2005) similar to the visual studio tools -> options I quite like that interface - use selects an item from a tree and on the right hand side the appropriate controls are displayed... My question is how do you think the programmers did it in Vis Studio - I'm after best practice here... I'm guessing that they create the controls dynamically - and it looks like they create them dynamically on demand - and keep them hanging around in case they need to be displayed again any insight welcome - and are there any clever code samples showcasing this thanks Bruce Yes, the controls in design mode are actual controls created dynamically, and subclassed by the ...Show All
mikecuth Open Directory Dialog
I am looking for a way to have an open directory dialog, I was hoping to use the standard FileDialog and make a few changes but that is not a viable option. I was hoping not to have to create my own. Any ideas theTroll Why is it not a viable option We can't suggest much if you don't know what your criteria/requirements are. From the MSDN about FileDialog: " FileDialog is an abstract class that contains common behavior for the OpenFileDialog and SaveFileDialog classes. It is not intended to be used directly but contains common behavior for those two classes. You cannot create an instance of FileDialog . Although the class is declared public, you cannot inherit from it, as it contains interna ...Show All
ricky rich How to compare values from two databases.
Hello, I have two different databases that I want to compare values from. I was thinking of loading the data into two separate listviews and then comparing the listviews but I dont know if that is the right way to go. Should I be using a datagridview instead Any ideas how to solve this problem. Regards The windows forms listview does not support databinding. I would use the datagridview to display the data. Red-Gate has some tools for comparing databases. Hi if you want to show something from database to the listview here is an example using Access Hope it help u. lv = new ListView ( ) ; lv.Left = 0 ; lv.Top = 0 ; lv.Width = 700 ; lv.Height = this .ClientRectangle.Height ; lv.GridLines = tr ...Show All
TA123 Tooltip component to have TTS_CLOSE...
Any way to pass TTS_CLOSE to the Tooltip component so that it will have a 'close window'... You can get some information and wonderful examples in the following link http://msdn.microsoft.com/library/default.asp url=/library/en-us/dv_vstechart/html/pinvoke.asp I am aware of the contents in that link. My question is aimed at the Tooltip component that comes with .Net 2.0 framework. Currently am using the code in the link that you have mentioned. But, what I am more interested in is extending the 2.0 component instead of 're-inventing' the wheel... Any way I can achieve that TTS_CLOSE if poorly documented, to put it mildly. I couldn't get it to work by overriding the CreateParams property. My guess: it only works ...Show All
olakara How to prevent tab from losing focus when in last row/ last column
Greetings: I am inheriting from the DataGridView. It is a register-like application with columns for SKU, Item Name, unit price, subtotals, etc. The datagridview is set to allow "new rows". I have been able to get the DataGridView to skip read-only columns. The only problem I'm having and can't seem to get easily is that the DataGridView by default loses its focus when the selected cell is the last row in the last column. When you press the tab key, it will tab over to the next control on the form. Rather, I'd like it to either tab to the first row or not tab at all (since the last row, last column is the new row). I have attempted to override OnLostFocus and set the focus back on the grid. This works, however, it really messes u ...Show All
Dietz How to get two columns in a dropdownlist of combobox?
Hi I have a combobox to display the following in drop down list (I am using VB.net or VS 2005). Apple Peach Mango So How to make the dropdown list to display the following (Two Columns). (In access database you can add many colums to the combobox's dropdownlist) Apple | Fruit Peach | Grade Mango | Tropical After made the selction only the single column should display in the combobox Apple or Peach or Mango Advance thanks The standard combobox doesn't support multiple columns. Use solutions on codeproject like Multi column Combobox vb.Net Multi Column Combobox c# Auto Complete Multicolumn Combobox ...Show All
