|
Why search by adapter name! It can be renamed. There is the NetworkInterfaceType property in the NetworkInterface class so you can know if an adapter is a GenericModem, Ethernet...
Network.IsAvailable[^] indicates network availability (which can be just a LAN without internet access). NetworkInterface.OperationalStatus indicates network adapter state. Both don't indicate internet access which I assume it's what you seek. In this case, use the System.Net.NetworkInformation.Ping class.
Eslam Afifi
|
|
|
|
|
Hello Everyone-
I'm just getting started with doing some Windows Forms programming. I'm wondering what the proper way to go about designing a Form with multiple pages in it is. I am wondering if there is a way to design this all in the Visual Studio Editor rather than create all the controls in code and place them.
Here's an example of what I want to do. If you've ever seen Outlook. Left hand side there is a bunch of options. Calendar, Mail, etc. You click Calendar and the right hand page shows you the calendar view. If you click on Mail, the right hand side shows you your mail. I'm looking to have functionality similar to this. You select an option on the left hand side, and the right hand page is displayed based on what the end user wants to do.
I'm wondering if it is possible to create all of this in the Visual Studio Editor so I can draw controls and size them and all that good stuff. What I am basically looking to do is almost have a Tab Control on the right hand side with multiple tabs and different controls on those tabs, and the ability to edit them easily in the editor (like with the tab control, you click on the page and presto, you can draw whatever you like on there) ... looking for the tab control without the tabs on the top!
Thanks so much in advance. I'm just looking to be pointed in the proper direction is all. Spent two hours searching but can't find exactly what I am looking for.
|
|
|
|
|
shultas wrote: I am wondering if there is a way to design this all in the Visual Studio Editor rather than create all the controls in code and place them.
Of course - there's a forms designer in visual studio.
The way I'd do this, is to create controls for all the views, put them all in a control, and just change which one is visible as the option is selected to show them.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Ok I'm familiar with the form designer in VS. What I'm not familiar with is ... "create controls for all the views, put them all in a control, and just change which one is visible". So "Put them all in a control", what control? What would I draw using the forms designer to place all of these controls into? I was thinking of something such as a panel, but when I set Visible of the panel to false in the designer it does not "disappear" from view, making it impossible to draw multiple panels with multiple controls and design it easily.
Thanks!!
|
|
|
|
|
shultas wrote: So "Put them all in a control", what control?
Any control you like. Create a user control for each pane, you can set that up in the designer. create a control to hold them all with a property to set which one is visible.
shultas wrote: when I set Visible of the panel to false in the designer it does not "disappear" from view,
Which is why you create each one as a seperate control, THEN put them all together.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Righteous. That's exactly what I was looking for, the proper thing to do, which appears to be a User Control! Now I can go look up how to do that! Thank you very much I really appreciate you taking a few moments to help me out.
|
|
|
|
|
no worries, glad to help.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
I agree this is my approach as well, one main application view which has a panel or any sort of container to hold other possible views, this makes for the best possible approach as far as i know to allow as much extensionability or maintainability as possible.
|
|
|
|
|
Hey,
I'm programming a little app, and I need a code in order to search a web page for a word, and clicking on it or copying it etc.
Or if that is hard, maybe extract all the links into a file and then searching the file..
Any of these will do it.
Obviously C#..
Thanks
|
|
|
|
|
|
Are you asking for a suggestion on where to start researching, what design pattern you should use for this type of application, whether it should be web based or forms based?
I don't see the question.
|
|
|
|
|
I thought that I could ask for the code in here..
So I was asking for the code if anyone can do it.
|
|
|
|
|
p3rson wrote: I thought that I could ask for the code in here..
You can, but like everywhere else in the world if you want something done for you, you pay for it.
|
|
|
|
|
Free source code is available in most of the articles. Search them and see if any do what you require, check the applicable licence and away you go.
If you want to write the code yourself, then have a go and if you get stuck, ask in the forums and we will help if we can with specific problems.
If you want code writing, then this is the wrong place. You will have to pay for that and use somewhere else - such as the site that was linked to in an earlier reply.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
I think the other posts burned you well enough.
At Codeproject, learning is encouraged over seeking free work. You can try and we can help, but we will not construct an entire project for you without payment.
|
|
|
|
|
ok i understood..
thx anywayz
|
|
|
|
|
Hi
i use this article to reading excel 2007 via c# :
Loading and reading the Microsoft Excel file contents using C#[^]
but the following error display me :
Old format or invalid type library. (Exception from HRESULT: 0x80028018 (TYPE_E_INVDATAREAD))
this error ocuured in this line :
Workbook workbook = app.Workbooks.Open(path,
0,
true,
5,
"",
"",
true,
XlPlatform.xlWindows,
"\t",
false,
false,
0,
true,
1,
0);
how to solve this problem ?
thanks
|
|
|
|
|
Hey guys!
I have two datagridview's. Both have the same datasource (a datatable).
Now the datatable contains an email address in every row. I have a function to validate an email address.
I want to display the rows with malformed email-addresses in the second datagridview without loosing the connection to the datatable, so that if I delete a row in the second datagridview, it should also appear in the first datagridview.
Is it somehow possible to filter the rows in the second datagridview?
How would you solve this problem?
Thank you guys!
Skyline
|
|
|
|
|
Provide a separate BindingSource for the second DataGridView. then use the filter mechanism of this BindingSource. See A Detailed Data Binding Tutorial[^] for more detail.
skyline92 wrote: so that if I delete a row in the second datagridview, it should also appear in the first datagridview.
I'm not sure if I correctly understand this part of your question. But unless you do some trick handling for the delete in the second DataGridView, any rows deleted will be removed from the DataTable on commit and will therefore be deleted in the first DataGridView as well.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Hey!
Thank you for your answer!
That helped me a lot!
My current solution looks as follows:
frmMailBatchMalformedMails frm_malformedMails = new frmMailBatchMalformedMails();
frm_malformedMails.GridViewDataSource = this._boMailbatch.GetMalformedAddressesView();
frm_malformedMails.Show();
-----------------------
public DataView GetMalformedAddressesView()
{
EnumerableRowCollection<DataRow> malformedMailsQuery =
from addressRow in AddressTable.AsEnumerable()
where !ValidateMailAddress(addressRow[MailColumnIndex].ToString())
select addressRow;
return malformedMailsQuery.AsDataView();
}
I think that is a good solution (also includes LINQ for filtering the malformed mail addresses in the rows).
Is it possible to save the changes in the second datagridview temporary and show the changes in the first datagridview only then, when the user clicks the save-button?
How would you solve that?
Thank you very much!
modified on Tuesday, June 30, 2009 12:57 PM
|
|
|
|
|
skyline92 wrote: Is it possible to save the changes in the second datagridview temporary and show the changes in the first datagridview only then, when the user clicks the save-button?
I do not think that it is, not while both grids are bound to the same datatable.
Perhaps someone else might know a method.
Good Luck!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
This is what I get when I try to open a WPA form. The design view will not open it said it's not there and the install will not work. All I get is the code windows. What can I do?
THIS IS THE ERROR!
There is no editor available FOR WAP FORM Make sure the application for the file type (.xaml) is installed this is the error! If it's not why did not setup do it? What do I look for? And the form designer work why don't this?
I tried to reinstall VS.NET but that did not help, where or what file is the C# editor so I can make sure it's there. I can not uses WAP forms untill I find out why it do not open.
|
|
|
|
|
Here the same error
Using Visual Basic 2005 Express Edition for several months and build an application that still works,
but needed on some parts an apdate.
Starting the View Design editor, I got the following error.
There is no editor available for: C:\ ?.vb
Make sure the application for the file type .vb is installed.
There are more errors.
The properties window isn’t accessible and also
the application properties window.
Under
Tools/Options.
Windows Form Designer.
An error occurred loading this property page.
Under
Tools/ Import and Export Settings Wizard
The operation cold not completed.
Under
Tools/ A new item apeared Create GUID.
Reinstalled Visual Basic 2005 Express Edition
Reinstalled Framework 1.1
Reinstalled Framework 2.0
Surfed several hours on the Internet but didn't find a solution.
Please help.
Henk van Andel
you can see
http://social.msdn.microsoft.com/Forums/en-US/Vsexpressinstall/thread/546def3d-9f8c-4057-8775-c8b16873d9a3/[^]
|
|
|
|
|
Whenever I use CancelEventArgs I iterate over the invocation list and check the Cancel state for each subscriber and break if true, so if any subscriber cancels the process, it is sure to be cancelled and further subscribers will not get called.
I'm needing to customise the BackgroundWorker, so had a quick look at the source code for it and was suprised to find that it doesn't use this policy. If there is more than one subscriber, then only the last one in the invocation list is able to properly set the Cancel that is carried through to the RunWorkerCompletedEventArgs . If the first subscriber sets Cancel to true, the second will still get called and can set it to false!
What would you say is the best practice - my way, or Microsoft's, or is there some in between method that would be better?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
|
|
|
|
|
Talking to myself here
On reflection, although there's no way to enforce it, all subscribers should probably be called, but each one should check Cancel first to determine whether they should proceed, so MS's way would be the correct method.
Edit: Just came accross this[^] which seems like a perfectly good way of handling it, so cancel can only be changed from false to true - could be done just as easily in the property's setter.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn) Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia) Why are you using VB6? Do you hate yourself? (Christian Graus)
modified on Tuesday, June 30, 2009 5:06 AM
|
|
|
|