|
A Type describes the class (or enum, or whatever). It is not the class itself. You need to use Activator.CreateInstance in order to get the actual class
|
|
|
|
|
Hi guys!
I'm new to network programming so i'm sorry if this question is a little noobish. I started using the WebBrowser Control in c# and so far it has done my purpose. But I want to know if there is a way to utilize this same control (so I won't change my code) without the visual display. Is it possible to "hide" the control but letting it stay active? Or is there a usable base class where the WebBrowser inherits its properties and methods?
Thank you guys!
|
|
|
|
|
You could try setting the Visible property to false. You could instantiate it, but not add it to the Controls collection. If you wanted to, you could even use a HttpWebRequest to get a webpage's source
|
|
|
|
|
My first intuition was to set the visibility to false, but then it turns out that doing so disables the whole control and thus the rest of my code wont work. What do you mean by "You could instantiate it, but not add it to the Controls collection"?
Btw, I tried to instantiate it instead of adding it the control from the designer by the code: webBrowser webBrowser1 = new webBrowser(); However, it didn't work in this manner. I also can't seem to find a property that would let it not display.
I also have a code using HttpWebRequest and HttpWebResponse, but its a lot longer and I don't know how to send multiple posts and how to activate a button click...
|
|
|
|
|
I got it, there was this code: this.Controls.Add(this.webBrowser1) that adds the control to the windows form, All I had to do is comment it out.
Thanks for the help!
|
|
|
|
|
Hi,
I would like to know if I can include a progress bar when I'm trying to copy files from one location to another with :
1. The file count unknown to me.
2. The size of each file is unknown to me.
For the above conditions, I'm able to get the normal progress bar which shows progress between the starting and final positions repeatedly.
The question is whether I can use a progress bar that shows the overall progress, just like the windows file copy progress bar...
Can anyone help me on this?
Thanks in advance,
ramzg
|
|
|
|
|
if you don't have the numeric information, you can't show progress information, all you can do is indicate it is still busy.
so figure out what you mean by progress, and once you know how to do it by hand, you can create some code that does the same.
|
|
|
|
|
Hi Luc Pattyn,
Thanks for the reply.. Ya, it is not possible to show progress information here... But I forgot to include this in my question... Would I be able to get the animation that windows uses (with a transparent background, so that I can place it on my form) to indicate that the files are being copied? Or do I have to create my own animation?
Thanks,
ramzg
|
|
|
|
|
|
ramzg wrote:
I would like to know if I can include a progress bar when I'm trying to copy files from one location to another with :
1. The file count unknown to me.
2. The size of each file is unknown to me.
For the above conditions,
If you know the source of file the what is problem with counting file or File Size.
ramzg wrote: The question is whether I can use a progress bar that shows the overall progress, just like the windows file copy progress bar...
Use BackgroundWorker to show step by step process. Ref
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
hi,
i want to call explicitly picturebox_paint(object sender,painteventargs e) event on the buttun_click event,how we can call this method on button click,because paint event is automaticlly call on formload and i also want to use paint method parameter on the time of calling...
plz suggest me best method for that.
thanks in advance...............
|
|
|
|
|
picturebox.Refresh() should do
|
|
|
|
|
please how can i load rgb image data to array and then print it to screen from array using c#
i appriciate your reply
thank you
|
|
|
|
|
That seems like an odd thing to do.. But well, you could make an uint[] and use LockBits on a Bitmap and fill the array using unsafe code, then make a new Bitmap use LockBits again and then write the pixels back (unsafe code) to the new bitmap and then display the bitmap. Why? Because you asked.
Alternatively you could fill the array of uint s with whatever else you want.
|
|
|
|
|
I'm new to C#.
I am using WebBrowser control in a form. I have a 'Back' button on the toolbar. I would like to disable the button based on 'webBrowser.CanGoBack' property. However, when browsing, I do not know when someone has clicked a link to a new page and I do not know how to create an asyncronous callback to check the property (other than using a timer; which I don't want to do). MFC C++ has MS custom WM_KICKIDLE message which could be used for such things. Can someone suggest a preferred method to do this?
thanks.
|
|
|
|
|
Sorry all. I figured out how to do it.
Thanks
|
|
|
|
|
Hi All,
There is an interesting Article "Nav Autoupdate with c#" under Library section
Link:
http://www.codeproject.com/KB/library/AutoupateNAV.aspx
Thanks
|
|
|
|
|
Please, stop spamming the board. Your article is very good, but you don't do it any justice by posting about it every four hours or so
|
|
|
|
|
Makes me think of the "hey I found this site.." posts spam on usenet - that is not a good thing
|
|
|
|
|
Tooting your own horn?? What's the point of constantly posting "Hey I wrote this cool article" every four hours?? You're not going to get MVP status by doing that, if that's you're motivation.
|
|
|
|
|
Dave Kreskowiak wrote: You're not going to get MVP status by doing that, if that's you're motivation.
I don't know, if he keeps it up he's a shoe-in for the Most Vapid Prat award.
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
<JSOP>
Don't univote someone's articles because you think they're an idiot on the forums
</JSOP>
Today's lesson is brought to you by the word "niggardly". Remember kids, don't attribute to racism what can be explained by Scandinavian language roots.
-- Robert Royall
|
|
|
|
|
Awww!!!
|
|
|
|
|
Hi,
I have a COM component where i have declared restricted/hidden methods and properties.Using Reflection I am accessing these methods and properties.Is there any way to filter out restricted properties alone? I can able to do for methods but not for properties.
here is my code for methods:
foreach (MethodInfo mInfo in obj.GetMethods())
{
string FuncAttrib = "";
TypeLibFuncAttribute attrib = null;
attrib = (TypeLibFuncAttribute)Attribute.GetCustomAttribute(mInfo, typeof(TypeLibFuncAttribute));
if (null != attrib)
{
FuncAttrib = attrib.Value.ToString();
}
//Filter the Restricted methods.
if ((FuncAttrib.Contains("FRestricted")) || (FuncAttrib.Contains("FHidden")))
{
//here we will get only restricted.Hidden methods
}
}
This is working fine for methods.here I have used TypeLibFuncAttribute which is applicable to method alone.Can anyone help to apply this logic to properties?I have searched the attribute similar to method but not able to get......
Thanks,
Rajan.
|
|
|
|
|
A am using access mdb database and using obleDB class.
when i run insert query on this table it runs successfully but record does not appear into data table.
i am using ..
objConnection1.Open();
objCommand = new OleDbCommand(Sqlstr, objConnection1);
Data = objCommand.ExecuteNonQuery();
// it gives data = 1
my connection is ok because i am getting value using this connection when i use Executescalar() on this command object
why it is.....
|
|
|
|