|
Seems like we misunderstood each other. I SAID that JUST controls which use ITypeDescriptorContext.Instance property were behaving badly. NOT ALL CONTROLS. I could still implement designers without problems, but if i wanted to use instance property i would get those messages. Ok?
At that time i was using framework v1.0 and upgraded to v1.1 (if i still remember). Then i had my OS reinstalled (+VS 2003). And i believe that i would still have the same problem, because MSDN still says that there may be some nulls in this interface. Do you suggest me to try again? (now when i reinstalled everything)?
When i blamed Framework, i didn't mean anything bad, it was more like a joke... sounded funny to me at that moment... I'm not a big fan of MS, but i think they did a good job with framework.
No i was not talking about Delphi .NET, because of reason you wrote. I wrote those controls in Delphi 6, so there's no .NET support.
|
|
|
|
|
I am using the app.config for some purposes that it wasn't meant for, or says microsoft, lol. I used a really great example off of code project that allows me to write back to a app.config file while my project is running. My only problem is, it seems that the assembly holds a copy of the file in memory, and when I write back to it, it doesnt reflect the changes when I read from the file again, it shows me the orginial values. Is there a way to refresh the app.config file after writing to it?
Thanks,
Ryan
|
|
|
|
|
What I know about the app.config file, is that it loads with the AppDomain.
Take a look in the AppDomain documentation to see if you can reload the config file.
Free your mind...
|
|
|
|
|
Once a process is executed in an AppDomain , the configuration information cannot be changed. If you must do this, you must have a process that creates a new AppDomain to run your primary application, which must also exit when the .config file changes. Your host (the launcher) would watch for changes to the .config file and respawn your application after it exits. This is how ASP.NET works, where the host is the ASP.NET worker process (aspnet_wp.exe).
You are right to think that the AppDomain keeps it "cached" (it's actually a one-time read per section, and each section is cached when its read for the first time). The only way to re-read the section is to spawn a new process in a different AppDomain that reads that .config file again.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi Everyone...
DOes anyone know how to do a simple HTTP Text Browser? If you do, can you help me out and email it to me no later than Saturday morning to Guiro565@yahoo.com...Thanx
|
|
|
|
|
Slap a multi-line TextBox in a form with an address bar and a couple buttons, then use the HttpWebRequest and HttpWebResponse (or the WebClient ) from the System.Net namespace. Enabling hyper-linking would be a little more difficult, but not impossible.
Why not just add a WebBrowser control to a form? There's plenty of documentation here on CP and the rest of the 'net (just google). Just drop the Microsoft WebBrowser ActiveX control on a form. A couple of interop assemblies are generated and you now have your own container for the WebBrowser control, just like Internet Explorer (i.e., iexplore.exe). It takes care of everything itself. You can handle events, implement interfaces (sometimes need to create an interop assembly for some interfaces, or define them manually), and walk / change the DOM (reference the Microsoft.mshtml.dll assembly).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Would you happen to have any source code on the above. It will be greatly appreciated!
Guiro
|
|
|
|
|
There's plenty of example code here on CodeProject, and much more on the 'net. Just google for it. CodeProject also has a nice search feature you should use.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Is there a way without using COM Interop to enumerate the virtual folders in my system from .Net? My requirement is to build a tree view exactly the same as that of Windows Explorer, with desktop as the root.
|
|
|
|
|
Hi, I hope this is helpful to you. I remember reading about this in the WMI SDK. You can get this information using WMI, which does not use COM, so you should try that. However, I cannot give you any help with the code right now, as I am not at my computer.
|
|
|
|
|
Does anyone know if you can find a closing brace from it's current opening brace in the IDE ?
If you have some deep nesting and the closing brace is off screen it would be nice to find it
quickly based on the opening one.
Thanks in advance.
Rgds,
Ian
|
|
|
|
|
place the cursor either at "{" or "}" and press ctrl+}
|
|
|
|
|
Great tip! Sometimes it's the little things, but I can't tell you how many times I've counted curlies or deleted and reentered one to see its mate bolded for a second (Oops, missed it! One more time.)
Charlie
Here I am. Love me.
|
|
|
|
|
control-]
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
top, works a treat.
thanks !
Rgds,
Ian
|
|
|
|
|
Hello,
does somebody know how I can get the current text-cursor-position (in pixel from the upper left of the window) in a RichTextBox?
Thank You
Bernd
|
|
|
|
|
Use the RichTextBox.SelectionStart property and RichTextBox.GetPositionFromCharIndex method:
int charIndex = richTextBox1.SelectionStart;
Point p = richTextBox1.GetPositionFromCharIndex(charIndex); The point is relative to the control.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hey
I have a Panel Libary class that contains of buttons. Each button has a click event.
I use a panel object in a diffent class named OurMain. When I trigger the butten_click event in the Panel Libary class it should trigger an even in the OurMain class. So far I have oused a hidden Label in each class, so that when a button is pushed, the Label in Panel Libary class gets a different value, The Label in the OurMain class then gets the new value as in the Panel Libary class. In OurMain class the Label has a on Label_TextChanged method, from there I call the different methods I want to trigger in the OurMain class.
This works for most of the time, but not allways .
The question is, is there a better and more safe way of doing this?
Thanks for your help
Thomas
|
|
|
|
|
You could add an event to the Panel class, then have the Panel handle all the Button.Click events, which fires the event you added. Done right, the form containing the panel could access the button (the first parameter in any EventHandler -derived delegate is the object that raised the event). You could even make your own delegate (instead of using the EventHandler delegate) if you don't want to worry about casting:
public delegate void ButtonEventHandler(Button sender, EventArgs e);
public class MyPanel : Panel
{
public MyPanel()
{
button1.Click += new EventHandler(this.button_Click);
button2.Click += new EventHandler(this.button_Click);
}
public event ButtonEventHandler ButtonClick;
private void button_Click(object sender, EventArgs e)
{
if (this.ButtonClick != null)
this.ButtonClick(sender as Button, e);
}
} Then, any button click event is handled by the panel, which then fires it's own event. Note (as I mentioned above), you oculd just stick with the EventHandler delegate for your event, but then your containing Form will have to type-cast the sender each time (making sure that it is a button, of course). Even in the code above, though, your Form should make sure sender isn't null (always better to be safe than sorry).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
and i need to display word docs on my form and handle it.
i can do this with excel docs by adding it's component in the toolbar from com components. but there is no com component for word. and i do not know what is the problem exactly!!!!
Iam using vs.net 2003 profissional and office 2002(xp) and can not use office2003
thnx in advance
|
|
|
|
|
Not sure what you mean by "handle it", but you can host the web browser and navigate a word document there.
RSS feed
|
|
|
|
|
first :thanx so much
second :handel it mean: i need to count words, catch user events, merge to file....things like these.
do u mean to host my web browser in my form and open my doc file in the web controle??
i'll c what can i get from this
thnx another time
|
|
|
|
|
Handling a word document the way you want it and showing it at the same time is best done in the context of a Word add-in, where you get both your freedom and the automation handle to play with.
I'll definitely would go that route, rather the opposite where you are asking for troubles.
Plenty of articles for writing your add-ins everywhere.
Troubles since :
- As of date, winforms don't (directly) support active documents (ole container). Whidbey due in June is supposed to solve this, but I guess this is too late!
- Internet explorer is a ole site for all sorts of things, including active documents. So if you host IE in your form, it can in turn act like a host for whatever OLE document including Word, Excel, ... But showing it is mostly the thing you can do with it. It's much harder to tunnel commands this way.
- Although C# does COM interop, it's not very good at doing this, especially when you need both the visible stuff, and the automation stuff. What I mean is that there are a lot of problems when you the stuff to release well from the memory, to behave well when you click, etc.
Good luck!
RSS feed
|
|
|
|
|
after alot alot alot of searshing i agree with
but i have a project and i have to finish it any way, and i'll not give up till i finish it, event if i have to code any needed objects for this, but i do not want to go that way now, i have found com component that display the doc but i can not play with it,
........................!!!!!!!!!!
|
|
|
|
|
Vocjeny
|
|
|
|