Answer Questions
Anand Raman - MSFT Use internet explorer urls
I'm making a webbrowser. Now i want to load the same urls that IE uses to a combobox, and set them too. In fact, I just want to know how to get access to the IE urls, so i can set/get them in my app. I hope that I am clear enough. Thanks in forward which urls favourites or urls in general urls in general, I believe in the combobox there is a property called autocompletesource, in here, set it to "AllUrl" which will then hopefully show the url's stored in the system as you are typing. in the autocompletemode set it to perhaps suggestAppend to make it complete the urls whilst you are typing and filters the url appropriately as you are typing If that dosn't work the 'recently typ ...Show All
imdz New C# Keyword - retry?
I believe that C# could benefit from extending try-throw with retry keyword. Simple example of this would be: try { PerfomAction(); } catch(Exception ex) { DialogResult dr = MessageBox(ex.Message, "Error", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Question); if(DialogResult.Retry==dr) retry; // Jumps to the begining of try block } IMHO: This makes for cleaner-looking and less bug-prone code than the alternatives with goto or loops. I know how to create logic and did it with both do...while and goto (which IMHO looks as much cleaner implementation): retry: try { //... } catch(Exception ex) { // ... if(condition) ...Show All
Ray Z. Yang why multiple inheritance of classes in not supported in C#?
Multiple inheritance is not supported in C# but it can be achieved using interfaces is fine. But can you explain why multiple inheritance of classes in not supported in C# its really nice answer like that many ques. come in my mind, like if oops concept we use and implement then why provide delegate.and how oops concept helps. Of course, multiple inheritance could be problematic if you are not careful when programming. But I'd rather have that depending on me, not because the underlying technology does not allow me. Multiple inheritance causes problems, if one or more of the parent classes defines members with same identifier. You would have to decide which parent to use to handle each met ...Show All
KissPsycho C# Code on browse
can anyone provide a code where i can browse and select directory and appears the directory i select in a txtFilename..so that i can save the file in the directory... thanks alot you shouldnt need to do all that, take a look at my response to your other thread: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=818228&SiteID=1 now are you trying to implement some save file feature if so, you can use the SaveFileDialog class instead to choose and save the file you want to save to, then write to the file in your own code. Take a look at the class: http://msdn2.microsoft.com/en-us/library/sfezx97z.aspx hi... i found this code string strPath; string strCaption = "Select a directory."; ...Show All
shekhar saran VB6 - C#
Please delete this thread - it started off as an unclear question, and once made clearer was never answered (or at least I think it was made clearer), and has now been resolved thanks to the MSDN Library. Can you elaborate your question Clearly. Could not get what you are lookign for and what ou are going to do. Best Regards, Delete thread - has no purpose Hi Eragon, 1) use System.Windows.Forms namespace 2) see components FolderBrowserDialog and OpenFileDialog 3) I don't understand what you mean be "edit files like Windows Explorer". How does Windows Explorer "edit" files If you want to show files have a look at class ListView. -- SvenC ...Show All
ajma CheckListBox select single item...
hi.. How i can select single item in a CheckListBox... I want to enable it or disable a single item or i want to check it or uncheck it... Thanks in adavance, Vinay You cannot disable individual items like you can a control, but you can prevent item's checked value to be changed by using ItemCheck event: private void checkedListBox1_ItemCheck( object sender, ItemCheckEventArgs e) { if (e.Index == 2) { e.NewValue = e.CurrentValue; } } The above code doesn't allow third item's checked value to be changed. I'm sure you'll find a better way to check whether the item's check state is allowed to change or not (probably through some of item's properties...). Andrej I'm no ...Show All
Christian Sparre Foreach problem -->
I am using an OpenFileDialog. OFD.InitialDirectory = Environment . SpecialFolder .MyDocuments.ToString(); if (OFD.ShowDialog() == DialogResult .OK) { //I need a FOREACH statement here// } Now, I need to open multiple files and put them in a list view. How can I do this I have tried foreach (OFD.FileName file in OFD.FileNames) {}, but I need a TYPE. In the DoubleClick event Foreach(ListViewItem lvi in listView1.SelectedItems) { string file = lvi.Text; /// play it here } Say the files were MP3s. How can I play the selected file I already know how to play a file, but cannot figure out how to in a list view. This doesn't work. private QuartzTypeLib. FilgraphManager graphMa ...Show All
zbethem Exception.Message brings more than defined
Hi, in a web service, i have a webmethod and, in some cases, i’m generating an ApplicationException this way throw new ApplicationException("APP..."); in my application i catch this error with a SoapException like this: catch(SoapException ex) { MessageBox.Show(ex.Message); } The thing is i don’t obtain TESTING..., i obtain something like "System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.ApplicationException: APP...\n at Service.HelloWorld(String nome)\n --- End of inner exception stack trace ---" My question is: how do i obtain only the message "APP.." and not the rest... Thanks MAIA I tried to use the field Cod ...Show All
a.s.viswa Compare ArrayList
Hello, I have 2 sorted array lists. e.g. arrayList1 = a,b,c,d,e,f,h,k,l and arrayList2 = a,c,d,f,g,h,i,j ArrayList1 contains the list of strings that are to be compared against. Unfortunately there are thousands of strings in each. So I don't know if it would be any good doing something like; does arrayList[0] == arrayList[0]||arrayList[1]||.... (in a loop of course). Another thing, arrayList2 is getting its (distinct) data from a database so I can't really check it against arrayList1 there and then, as it would leave the connection open for longer... I don't know maybe this is an ok trade off I don't suppose there is an efficient arrayList1.compare(arrayList2) method out there ...Show All
IrishGandalf learning to live w/o pointers (C++ programmer here)
Good evening- What I'm trying to do is take a variable, place a reference to it in a container, have some math operations act on the whole container (which might have any number of references to variables) and then be able to access the original data in the original variable. Hope that wasn't too confusing. In C++ this was performed by using references and pointers - I'd pass the variable to a function by reference, make a pointer, place the pointer into a container, do my operations, and at any time I could query the original variable and get the updated results since the pointer pointed back to it. How is this accomplished in C# I banged my head up against the wall for a few hours this evening trying a few things but I don't quite see ho ...Show All
Starfish2000 Difference between VisualC#.NET and C#
Hello All, Just a basic question. I am seeing several books called VisualC#.NET , C#, C#.NET What is the actual difference between those What is the relation ship between C# and dotnet. Please give me the concept Thanks, John Thanks to all for your valuable inputs. What is the relation ship between C# , CLR and dot net framework. How dependent are those to one another What happens if try to learn , code some samples with out dot net framework installed on the system If not possible with dot net framework, then Why and what is the reason The reason for these questions are, I am trying to learn C# and I would like to have a clear concept on hand. Any links which expla ...Show All
Charles Tam How to raise an event
I have two forms form1 and form2, when i click a button in form2 I want form1 to do something only if a button in form2 is clicked....How do i set up basics for an event to take place in this manner any help... You are right Ilyas, I agree that it will be bad design! Best Regards ;-) we all share and learn my friend :-) No event is needed in what you are trying to achieve. Create some public property or function on the form which has to work. On the other form's constructor, pass the reference of first form so it can call that function or property. Handle the Click event of the button on this form and call the othe form's function like this: mainForm.DoWork(); Cheers ;-) ill try my best but won't ...Show All
jorijo how to check if a file is read-only?
I used : if ((File.GetAttributes(file) & FileAttributes.ReadOnly) != 0) gave me error, saying The given path's format is not supported. I tried: if ((File.GetAttributes(azmanStoreFileName) & FileAttributes.ReadOnly) != 0 but gave me error, saying The given path's format is not supported. Can anyone help Thanks Hi, You can use the following code segment string FilePath = @"C:\TEST.txt" ; System.IO. FileInfo Info = new System.IO. FileInfo (FilePath); if (Info.IsReadOnly) { Console .WriteLine( "FILE IS READ-ONLY" ); } Hi System.IO. FileInfo fi = new System.IO. FileInfo ( @"C: ...Show All
Kamii47 Events
I know how events/delegates works. its when implementing them that seems to be the problem with me. now... I have: a Form several classes the form knows nothing, it only knows about 1 class, which it instantiates. this class instantiates other classes. The form, nor do the other classes, need to know about each other. now, I have successfully created events which when raised from the main form, one of the classes acts upon it - thats all good. what I want now, is the complete opposite. I want to make an event where, in one of these classes (not the class the main form creates) I can raise so that the main form picks it up and acts upon it. Since I am mostly confused at times when events are involv ...Show All
John Luke C# 3.0 in Windows Vista
I have heard something about it. Do anybody know when is it coming and is it going to be in Windows Vista Thanks, Timo OMG! 3.0 yet Wait to i learn the 2.0 first !! I'm studing for the 70-536 exam, i must go more quickly x'DDD Regards. Okay, thanks Shivam. I've now read some information about 3.0 and I find it interesting. Am I right if I say that it's possible to program C# 3.0 with Visual Studio 2005 Or do I have to have Windows Vista (RC1 ) Timo Thank you both axshon and Shivam11! I'm just downloading Windows Vista RC1 so soon I'm going to have a lot of work.. :) Regards, Timo Hi; A RC of net 3.0 was released on the 8th. On the site you will also find the SDK for Vista. I haven't used the .Net3.0 f ...Show All
