|
OK, so whats your problem?
|
|
|
|
|
Hi friend,
I want use pogressbar on MDI parent that should be loaded every time based on loading time of form of MDI Childs like in IE when ever we open website tha progress has shown in statusbar na like that i want.
|
|
|
|
|
Use delegates. MDI form should subscribe delegates declared on the child forms. Child form can call that delegate when update in MDI form is required.
|
|
|
|
|
Hi,
Can u send any sample code for that.
Thanks,
|
|
|
|
|
hai all,
i want access active directory to check some user for authentication. Im using windows authentication for my project.
i can access the active directory and check the valid users in windows XP with this piece of code.
DirectorySearcher search = new DirectorySearcher();
search.Filter = String.Format("(SAMAccountName={0})", loginName);
search.PropertiesToLoad.Add("cn");
SearchResult result = search.FindOne();
if (result == null)
{
return false;
}
else
{
return true;
}
but the problem is when i run the code in windows server 2003 or after deploying the solution in windows server i cant access the active directory. im receiving COM Exception.i think it may be configuration problem. its working fine with local IIS configuration.But its not working in server.. can anyone help me out for this problem. i have delivery on next ween. so kindly reply me ASAP
|
|
|
|
|
How do you call rollback from a custom action dll? (calling directly base.Rollback doesn't works, throwing InstallException is not OK because of the Unhandeld exception MessageBox)
|
|
|
|
|
Hello,
I'm trying to access an https page, I don't know why .NET doesn't allow it
here is the error I got
"The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel."
and when I try to override ServicePointManager.ServerCertificateValidationCallback with this function
public static bool ValidateServerCertificate(
object sender,
X509Certificate certificate,
X509Chain chain,
SslPolicyErrors sslPolicyErrors)
{
return true;
}
I got time out exception.
here is a snippet of my code
ServicePointManager.ServerCertificateValidationCallback += new System.Net.Security.RemoteCertificateValidationCallback(ValidateServerCertificate);
CookieContainer c = new CookieContainer();
reqLogin = (HttpWebRequest)WebRequest.Create(url);
reqLogin.Method = "POST";
reqLogin.UserAgent = "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3 (.NET CLR 3.5.30729)";
reqLogin.ContentType = "application/x-www-form-urlencoded";
reqLogin.KeepAlive = true;
reqLogin.CookieContainer = new CookieContainer();
reqLogin.CookieContainer = c;
reqLogin.AllowAutoRedirect = true;
reqLogin.UseDefaultCredentials = true;
reqLogin.Timeout = 5000;
using (StreamWriter sendingData = new
StreamWriter(reqLogin.GetRequestStream()))
{
sendingData.Write(postMessage);
sendingData.Flush();
sendingData.Close();
}
resLogin = (HttpWebResponse)reqLogin.GetResponse();
I'm sure that you faced that problem before, i'm searching about a solution for this problem from 4 hours and couldn't find any solution, I really hope that you can help me
Thanks in Advance.
|
|
|
|
|
|
You're having a laugh aren't you? You want the control, you write the code. You have the main bits (from someone else's effort) and now you want a mug to finish the job for you? Try www.rentacoder.com
Bob
Ashfield Consultants Ltd
|
|
|
|
|
|
arnold_w wrote: I've spent 15+ hours
Presumably PAID hours (or if not, then it's presumably for your own benefit), so now you are looking for someone to spend unpaid time doing your work. Best of luck, you will need it.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Obviously, it was a bad idea to post the question here so I have deleted my posts. It was wrong of me to find sample code on a forum, spend 15 hours trying to modify it to suit my needs and then when I got stuck ask for help here. In my opionion, the ComboBox lacks basic features and I have found several other posts on other forums where programmers are asking how to solve the problems with the lack of tooltip and enable/disable features. I have virtually no experience with the Windows API and was hoping that by posting questions here, a little joint development could solve these problems once for all. However, I realize I was wrong and I will never have such thoughts again.
|
|
|
|
|
What you were wrong about was that assumption that other people should write all the code for you. People here are not paid to give help, and do it out of pure kindness. If you want that help you need to show them some respect.
People here are generally happy to answer questions, but will rarely actually write more than a line or two of example code. What you were asking for was for someone else to do all the code for you.
How can you expect to write components like you describe if you have "virtually no experience with the Windows API" the first thing you should do is learn about the Windows API (Or winforms or WPF or whatever you choose to do it in).
You basically have three options:
1) Make the modifications yourself. You will need to learn the appropriate technology. If you get stuck, ask specific questions, and people here will give suggestions and guidance or point you towards articles or books that will help you. What they won't do is write the code for you.
2) Pay someone professional to make the modifications for you. www.rentacoder.com[^] might be a good place to start looking.
3) Find an existing component that meets your requirements out of the box. There are plenty of commercial companies that make .net components Telerik[^], DevExpress[^], Infragistics[^] etc, and if you google about a bit, there are also lots of open source projects.
Simon
|
|
|
|
|
Thanks for your post.
Simon Stevens wrote: What you were wrong about was that assumption that other people should write all the code for you.
The code was at least 90% finished and I had spent 15 hours on it. I did not assume other people would write all the code for me.
Simon Stevens wrote: If you want that help you need to show them some respect.
????? Are you implying I was disrespectful in any way in my post???
Simon Stevens wrote: What you were asking for was for someone else to do all the code for you.
The code was at least 90% finished and I had spent 15 hours on it. I have a feeling solving two of the three issue listed would require about 3-4 lines of code each.
Simon Stevens wrote: How can you expect to write components like you describe if you have "virtually no experience with the Windows API"
By finding example code on the Internet and asking questions on forums. I have done some pretty advanced stuff in C++, VB, LabVIEW and Matlab without having experience in those areas.
Simon Stevens wrote: If you get stuck, ask specific questions
I provided a list of three issues. I agree that one of the issues might have been a little involved, but the other two issues were very specific.
|
|
|
|
|
Well, it was mainly the asumption that as you ha spent 15 hours on it other people would also want to spend their free time too. You may have asked for help on 3 specific issues, but you posted loads of code that had to be read through.
arnold_w wrote: I have a feeling solving two of the three issue listed would require about 3-4 lines of code each.
In which case, why not write them?
arnold_w wrote: By finding example code on the Internet and asking questions on forums. I have done some pretty advanced stuff in C++, VB, LabVIEW and Matlab without having experience in those areas.
I beg to differ. Without a good understanding or experience of a language how do you know it was 'pretty advanced stuff' - to an expert it was maybe 'bread and butter' code. Who knows - or cares, come to that.
As Simon said, everyone here on CP gives up their time freely to help guide people, but are reluctant to spend ages reading reams of code or write more than a few lines of example code.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
Having a combobox with disabled items is pointless and contrary to the intended use of the control. What *I* would do is allow the user t select whatever he wanted in the control, and then enable/disable other form controls if the selected item is "disabled".
When you get right down to it, allowing them to even SEE a disabled item is pointless. If they're not allowed to select it, don't include it in the data.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thank you for giving me your perspective on this matter.
|
|
|
|
|
I tend to disagree. I'd much rather have optional items disabled as appropriate than have them appear/disappear seemingly at random. Best ofc would be to add a tooltip explaining what would reenable them. Not sure if that's doable with a combobox.
|
|
|
|
|
When I click the button on the winform to populate teh listbox with data, the form freezes and therfore do not see the listbox when data is being added to it.
When the population is done, only then the form is NOT frozen any longer and then I can see the data inside the listbox.
Is this to do with threads?
How do I solve this so that I can see the data as they are being added to the listbox?
Thanks
|
|
|
|
|
Yep, the populating is done in the GUI thread. The easiest way to solve this is by using a BackgroundWorker. Put the code for the population in the DoWork event of the BackgroundWorker and just start the BackgroundWorker when clicking the button.
|
|
|
|
|
You can't do this.
winforms controls can only be updated from the GUI thread.
Either do the processing on a background thread, and call to the GUI thread to update in batches, or do what Ashfield says and do all the processing before you update the listbox.
Simon
|
|
|
|
|
arkiboys wrote: Is this to do with threads?
Yes, your UI thread is tied up with populating your listbox
arkiboys wrote: How do I solve this so that I can see the data as they are being added to the listbox?
It doesn't make sense to do this really, the user cannot access the listbox until its fully populated so why show them it partially done? To keep the form responsive you could use a background thread to populate a collection of some type (say a datatable) and then just bind this to your listbox, but the user will not see the listbox contents until they are fully populated.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
The job takes aboout 4 hours to complete.
Data gets added to the listbox and so I would like the user to see what is being added...
Is there a way so that the user sees the listbox being populated?
|
|
|
|
|
arkiboys wrote: Is this to do with threads?
Kind of.
You are obviously doing a lot of stuff in the button click event handler.
A standard winforms app has a GUI thread which does all the form drawing and event processing. When you click the button, that thread triggers the event handler. If you then do a lot of time consuming work in the event handler, the GUI thread is tied up so can't do any other work, like redrawing the list box or processing other button clicks. What you need to do is do any long running tasks on a background thread. The easiest way to do this is with a BackgroundWorker[^]
One of the quirks of winforms is that only the GUI thread can actually update any controls. This means that you will need to do your complex calculations on the background thread, but switch back to the GUI thread to add the items to the list box. You use the Invoke method on the form to call code on the GUI thread.
if(this.InvokeRequired)
{
dosomethingdelegate dsd = new dosomethingdelegate(dosomethingmethod);
this.Invoke(dsd, anyParametersGoHere);
}
To do this, I would group them up into blocks, do the processing on the background thread, then call a method to add several at a time using the ListBox.Items.AddRange method on the GUI thread. This will also reduce the number of repaints of the list box that the app needs to do, so will improve it's performance.
Simon
|
|
|
|
|
Simon Stevens wrote: this.Invoke(dsd, anyParametersGoHere);
I'd go with BeginInvoke as it returns immediately without waiting the control to be updated. BeginInvoke is safe unless you pass reference parameters to the method which updates the control.
|
|
|
|