|
The line:
cm.Show(webBrowser,((Control)webBrowser).PointToClient(new Point(ppt.x,ppt.y)));
should be:
cm.Show(this,((Control)this).PointToClient(new Point(ppt.x,ppt.y)));
I guess passing the WebBrowser as the control the menu is shown for, makes it get a message to do its own command.
|
|
|
|
|
I used WebBrowser control in Windows Form and changed WebBrowser default context menu to my custom-built menu successfully. But a new problem occurred: all links in webpage are disabled when clicking mouse left button on them, that is when clicking links, there is no any respose, they can't go to new webpage. Did you ever encounter this problem?
Icey
|
|
|
|
|
I have a problem.
I have a form with multiple TreeView controls with the same ImageList (same SelectedImageIndex, but different ImageIndex). When the form loads, the images displayed are wrong: a TreeView charges a non-corresponding image. Sometimes, a TreeView charge images from another ImageList. I don't know if it's a bug or not, but I tried several ways without good results. I'm working with C# and FrameWork 1.1
Somebody help me!
Blaise L'amort
|
|
|
|
|
Am I correct in assuming you can have instances of both a BinaryReader and BinaryWriter attached to the same stream object? (My test worked, but that doesn't mean it wasn't a fluke.)
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
Whereever you write something, is has to be read at the other end of the stream. That's what stream are there for
|
|
|
|
|
Ha ha. I meant on the same end, thus the reference to the same "object"
When all else fails, there's always delusion.
- Conan O'Brien
|
|
|
|
|
When making an app in C(++) we always put the strings in a resource, as it makes it easy to change languages later on...
Whats the way to do that in C# when making a Winforms app?
I mean, we dont have real resources any more
- Anders
Money talks, but all mine ever says is "Goodbye!"
nsms@spyf.dk <- Spam Collecting
|
|
|
|
|
Just right click on the project and then clcik on Add New Item . You will get a dialog. On the left side click on the + for Local Project Items to expand it and you will see a list of stuff. The last one is Resources. Select Resources and then on the right hand side select Assembly Resource File. Put your strings in there.
|
|
|
|
|
Are there any simple examples of this? I would like to do this, but never used C++. I would love to see a simple app that gets its labels and text stuff from a resource...
rod
|
|
|
|
|
Hi!
I have the following question. Is there any way to know if an event (i.e. the click of a button) has an EventHandler associated? I need to know which event have eventhandlers and which do not.
Thanks,
Matias
|
|
|
|
|
<font color=blue>if</font>(<code>button1</code>.click!=null){
<font color=green>
}
<font color=blue>else</font>{
<font color=green>
}
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
I'm using an XML file to store user preferences, but I can't decide on what's the best format. The data would easily been stored in an INI file using sections, keys, and values, but I want to use XML instead. I'm come up with a couple of alternatives:
1.
<?xml version="1.0" encoding="utf-8"?>
<profile>
<section name="Some Section">
<key name="Some Key">Some Value</key>
<key name="Some Other Key">Another Value</key>
</section>
<section name="Some Other Section">
...
</section>
</profile>
2.
<?xml version="1.0" encoding="utf-8"?>
<profile>
<Some_Section>
<Some_Key>Some Value</Some_Key>
<Some_Other_Key>Another Value</Some_Other_Key>
</Some_Section>
<Some_Other_Section>
...
</Some_Other_Section>
</profile>
Which of these two would you choose and why? If you know of a better alternative, I'd love to hear it.
Thanks!
Alvaro
PS. I've already posted this in the XML forum, but since the code will be written in C# I thought I'd try it here too.
|
|
|
|
|
The first. The document structure isn't affeted by the data that you are storing. This will make a _big_ difference when checking your XML for validity against a schema. The second version would require a schema for every .ini file. This would make a.ini a different type from b.ini, assuming they had different keys.
Unless this is the behaviour you want..
HTH
Ryan
|
|
|
|
|
I agree totally. It's like if a collection class had a different member for each key/value pair it had stored in it rather than an indexer that accessed the values via the key.
When I can talk about 64 bit processors and attract girls with my computer not my car, I'll come out of the closet. Until that time...I'm like "What's the ENTER key?"
-Hockey on being a geek
|
|
|
|
|
Alvaro Mendez wrote:
The data would easily been stored in an INI file using sections, keys, and values, but I want to use XML instead.
Just another thought Alvaro, but you can still use XML with sections, keys and values. Take a look at my article : An extension for a Configuration Settings class in .NET[^]. Below would just be a sample layout you could use. Just my two cents worth.
<configuration>
<configSections>
<section name="ApplicationData" type="Support.ConfigSettingsSectionHandler, Support" />
</configSections>
<ApplicationData>
<add key="Height" value="618" />
<add key="Width" value="968" />
<add key="Top" value="116" />
<add key="Left" value="138" />
</ApplicationData>
</configuration>
-Nick Parker
DeveloperNotes.com
|
|
|
|
|
Is there a way to do this? I tried setting the PasswordChar of the textbox contained in my datagrid, but that only masks the text when that textbox is selected. If you click away from the textbox the masked text is revealed again. I'm binding to an array of MyClass objects contained within another object.
Here's my code:
<br />
dgServers.SetDataBinding(myClassCollection,"MyArray");<br />
DataGridTableStyle myTS = new DataGridTableStyle();<br />
myTS.MappingName = "MyClass[]";<br />
DataGridTextBoxColumn myCS = new DataGridTextBoxColumn();<br />
myCS.MappingName = "Password";<br />
myCS.Width = 500;<br />
myCS.TextBox.Multiline = false;<br />
myCS.TextBox.PasswordChar = '*';<br />
myTS.GridColumnStyles.Add(myCS);<br />
dgServers.TableStyles.Add(myTS);<br />
What do I need to override to get this to work?
Thanks
|
|
|
|
|
Okay, I worked this out with a little help from somewhere else. What you need to do is create a new class that derives from DataGridTextBoxColumn and override the Paint method. Here's what I did in case anybody else needs to do this:
public class PWColumn : DataGridTextBoxColumn
{
protected override void Paint(Graphics g, Rectangle bounds, CurrencyManager source, int rowNum, Brush backBrush, Brush foreBrush, bool alignToRight)
{
MyClass thisObj = (MyClass) source.Current;
string orig = thisObj.Password;
orig = Regex.Replace(orig,".","*");
this.PaintText(g,bounds,orig,alignToRight);
}
}
|
|
|
|
|
can any dll written and compiled in vb.net, c++.net, or j#.net be used unconditionally in a c# project?
|
|
|
|
|
|
Hi all,
I have to detag an HTML page. So I used the pattern
string pattern = @"(?i)<script([^>])*>(\w|\W)*])*>|(?<gt>(<(""[^""]""|'[^']'|[^>])+)?>)";
string strParsed = Regex.Replace(contenuHtml, pattern, " ");
with this I got text with some malicious code like ".maillink{color:white;text-decoration:none;}" and so on.
For exple having HHHHfunction(){ffff}je suis néo en C#jksfjksdfjkfkfj I would like to obtain the contain of the body "je suis néo en C#jksfjksdfjkfkfj" and trashing all scripts, css, links and so on.
Some one can help me giving to me the correct pattern for the Regex.Replace(....)?
Thanx very much
TT
|
|
|
|
|
I may be a little confused by why not just do something like this
int nStart = contenuHtml.IndexOf("");
int nEnd = contenuHtml.IndexOf("");
string strBody = contenuHtml.SubString(nStart+5, nEnd);
|
|
|
|
|
With this solution I cannot clean malicious code like tags options, some cascade style sheet options. Fro exple:
nnnnnnn
I would try to integrate your solution in my code and I hope it should run.
Thanx
|
|
|
|
|
What's the difference between:
1. "RequestOptional" and "PermitOnly"
2. "Demand" and "RequestMinimum"
|
|
|
|
|
how can i pass a parameter to a thread??
Thread thread = new Thread(new ThreadStart(threadFeed(feed)));
you see; I need to send the array "feed" to the method "threadFeed", but I it won't allow me.
I asked a friend and he said you couldn't pass parameters to threads...
If you can't pass parameters, how is the thread sopposed to get any outside information????
/\ |_ E X E GG
|
|
|
|
|
I know... that can be a pain. Put it in a variable that's reachable from the threadFeed method, and have the threadFeed method read it from there.
|
|
|
|