|
Hi,
In the Font object I can see no way to retrieve the filepath for a font. (I need to do this as some third party loads fonts from the filepath).
My knowledge of the Win32 API is very scratchy. Is there anyway I can retrieve the filepath for a font in .NET or is there a method on the Win32 API I can invoke to retrieve this information.
Thankyou
|
|
|
|
|
string fontpath = Environment.SystemDirectory.Replace(@"\system32", "") + @"\Fonts";
|
|
|
|
|
I want to modify the split container to add a button to the
splitter and to alter the shading of the bar but I can not find any
information on this topic Help?
Bob
|
|
|
|
|
Hi All,
I have created a custom datagridviewColumn control containig a TextBox+Button. I want to access the events of these controls directly, for example TextBox_textChanged, Button_MouseHover.i have found that In DataGridViewButtonColumn we have to access the button through Cell_Click event, but this doesn't resolve my problem. Can someone please tell me how to access the events of controls contained in DataGridViewColumns?
Thanks
sorry for my bad English.
|
|
|
|
|
Hello
If you've created that custom control then you control its events. You can do this in two approaches:
1- Make a custom event in your custom control. Handle whatever events you want to handle of the button and textbox private inside your control. From these handlers, fire the public event. Now handle that public event in your form.
2- Just declare your button and textbox as public members of your control. Then you will have access to their events as well. Programatically only of course -ie. you may not access their events using the PropertyGrid by default-.
Regards
|
|
|
|
|
Hi there,
I'm writing an XHTML site and i'm using FreeTextBox to do it, unfortunately is has a nasty habbit of breaking XHTML rules with upper case tags and removing closing slashes from image tags.
Now i've written a function which fixes allot of HTML errors which it (or the user) may create. The functionalitu i'm missing is a regex which will turn
<img src="foo" alt="foo" title="foo" anyotherattribute="anyother value" >
into
<img src="foo" alt="foo" title="foo" anyotherattribute="anyother value" />
Can anyone supply a regex replace pattern which will do this?
This is my function so far in case anyone else finds it useful.
public static string MakeHTMLValid(string strInput)
{
strInput = Regex.Replace(strInput, "<P>", "<p>");
strInput = Regex.Replace(strInput, "</P>", "</p>");
strInput = Regex.Replace(strInput, "<EM>", "<em>");
strInput = Regex.Replace(strInput, "</EM>", "</em>");
strInput = Regex.Replace(strInput, "<DIV", "<div");
strInput = Regex.Replace(strInput, "</DIV>", "</div>");
strInput = Regex.Replace(strInput, "<IMG", "<img");
strInput = Regex.Replace(strInput, "<LI", "<li");
strInput = Regex.Replace(strInput, "</LI>", "</li>");
strInput = Regex.Replace(strInput, "<H1>", "<h1>");
strInput = Regex.Replace(strInput, "</H1>", "</h1>");
strInput = Regex.Replace(strInput, "<H2", "<h2");
strInput = Regex.Replace(strInput, "</H2>", "</h2>");
strInput = Regex.Replace(strInput, "<H1 class=HeadingOne>", "<h1 class=\"HeadingOne\">");
strInput = Regex.Replace(strInput, "<P class=MsoNormal>", "<p class=\"MsoNormal\">");
strInput = Regex.Replace(strInput, "<UL", "<ul");
strInput = Regex.Replace(strInput, "</UL>", "</ul>");
strInput = Regex.Replace(strInput, "<BR>", "<BR />");
strInput = Regex.Replace(strInput, "<BR />", "<br />");
strInput = Regex.Replace(strInput, "<BR>", "<br />");
strInput = Regex.Replace(strInput, "<br>", "<br />");
strInput = Regex.Replace(strInput, "class=normalText", "class=\"normalText\"", RegexOptions.IgnoreCase);
strInput = Regex.Replace(strInput, "</A>", "</a>");
strInput = Regex.Replace(strInput, "<HR>", "<hr />",RegexOptions.IgnoreCase);
strInput = Regex.Replace(strInput, "<A ", "<a ");
strInput = Regex.Replace(strInput, "<SPAN", "<span");
strInput = Regex.Replace(strInput, "</SPAN>", "</span>");
return strInput;
}
"Gödel proved that any formal system that defines the primitive recursive functions must be either incomplete or inconsistent. In particular one could not prove from within the system that the system itself was consistent even though the question could be formulated within the system."
|
|
|
|
|
Parsing nested tags with regular expressions is not a trivial task, but for the tag it should work fine:
string to find: <img(?<content>[^>]+)>
string to replace: <img${content} />
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Thanks for that it worked like a charm
"Gödel proved that any formal system that defines the primitive recursive functions must be either incomplete or inconsistent. In particular one could not prove from within the system that the system itself was consistent even though the question could be formulated within the system."
|
|
|
|
|
Is there anything within the 1.1 framework that can do this automatically? The Delete() methods of Directory and Path both specify that they only work on empty folders.
|
|
|
|
|
How about:
Directory.Delete(@"C:\MyDirectory", true);
|
|
|
|
|
dan neely wrote: both specify that they only work on empty folders.
IIRC, they work only if the folder is writeable or is empty. Folders are typically writeable, so you shouldn't have any problems.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Dumbest. Movie. Title. Evaaar.
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
Hi,
I've got another question: I'm working with Visual C#.NET 2003 to make a web application, do you know a way to remember a user password? Like Websites do when they propose a checkbox: "remember my password?". Do you know how to do this in C#.NET?
Thanks,
Oren.
|
|
|
|
|
Save it as session variable or as cookies.
|
|
|
|
|
Hi Guys,
I use Visual C#.NET 2003 to build a Web Application. Now a problem is: when we run the application, an internet window is opened at a standard size. I'd like to have it opened "maximized" (taking all the screen size).
Does anybody know how to do this?
Thanks,
Oren.
|
|
|
|
|
Hi!
I think you'll have to execute some JavaScript code in the Load event of your web page, something like
window.moveTo(0,0);<br />
window.resizeTo(screen.width,screen.height);
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Hi
Does somebody know if it is possible to display animated gif in a cell in DataGridView and how to do it?
Thanks
Ela
|
|
|
|
|
what is the code for finding the square root of a number?
tony-yeyo
|
|
|
|
|
|
thanks man.
take care.
tony-yeyo
|
|
|
|
|
System.Math.Sqrt
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
^Does that make sense?
Well anyway:
User clicks X, i ask if they're sure they want to close, they say 'no', how do i stop the app from closing at this point?
|
|
|
|
|
In your form, override the OnClosing method:
protected override void OnClosing(CancelEventArgs e)
{
DialogResult result = MessageBox.Show("Sure you want to exit?", "Confirm", MessageBoxButtons.YesNo);
if(result == DialogResult.No)
{
e.Cancel = true;
}
}
Setting the e.Cancel property to true will stop the app from closing.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Dumbest. Movie. Title. Evaaar.
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
|
Hi,
I am using session variables in .NET 2.0.
How do I loop through all the sessions variables to see what has been populated?
And how do I kill/destroy a specific session variable? Lets say I have declared a session variable like Session["MyName"] = "Ma"; and Session["MyLastname"] = "Se", how do I only destroy/and release back to memory Session["MyName"]?? I mean if I were to loop through all the session then it should not exist at all.
I hope someone can help soonest.
Regards,
mase
|
|
|
|
|
Session.Keys contains all keys for the session variables.
Use Session.Remove to remove a specific session variable.
---
b { font-weight: normal; }
|
|
|
|
|