|
ok I just checked it returns True when it finds addrss scheme inform of File://
what i want to extract the non-file part from a url so that i could use it for further processing
for instance if there is a url like http://site.com/abc/efg/file.ext
i want to extract BOLD part from the Url,i could split w.r.t / and then check each chunk whether its a file or not,but i was looking for some built-in method for such task,Uri was working fine unless i encounter above mentioned problem
MyBlogs
http://weblogs.com.pk/kadnan
|
|
|
|
|
Hello Developers,
I want to create a rotated font, and I use the following code to achieve this, like in this sample (http://winfx.msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_fxsamples/html/7c8b073b-5889-45e7-9a99-ebee39fe3b79.asp[^]), but using 1.1 framework.
Font CreateRotatedFont(int angle, Graphics g)
{
LOGFONT lf = new LOGFONT();
// scale a 12 point font for current screen DPI
lf.Height = (int)(-16f * g.DpiY / 96);
lf.Width = 0;
// rotation angle in tenths of degrees
lf.Escapement = angle * 10;
// Orientation == Escapement for mobile device OS
lf.Orientation = lf.Escapement;
lf.Weight = 0;
lf.Italic = 0;
lf.Underline = 0;
lf.StrikeOut = 0;
lf.CharSet = 0; //LogFontCharSet.Default;
lf.OutPrecision = 0;//LogFontPrecision.Default;
lf.ClipPrecision = 0;//LogFontClipPrecision.Default;
lf.Quality = 5;//LogFontQuality.ClearType;
lf.PitchAndFamily = 0;//LogFontPitchAndFamily.Default;
lf.FaceName = "Tahoma";
return System.Drawing.Font.FromLogFont(lf);
}
Am I doing something wrong in this code, or maybe someone did similar code once?
Thank you!
|
|
|
|
|
|
Yes thank you, this is ok for beginning, and I used this method.
But what if I need to draw each letter of the word with different angle?
My thought was to create a number of fonts(30,45,60) degrees and draw each letter with such font. What do you think?
Thank you!
|
|
|
|
|
I made a simple control which has some additional fields and properties and inherits from Label. I also override the OnPaint method. The control has a border, which has a color and thickness. If I set the boreder thickness to 30 pixels, I don't see the first lie of text. Is there any way to make the control show the text inside the border? I know I can draw the string in the OnPaint method, but I want the base OnPaint to draw the string becouse it can center it, wrap and so on. Pls help!
|
|
|
|
|
No,
The base class doesn't know that you've drawn to the surface, once you start doing custom drawing your taking responsibilty to do all of the drawing (unless it doesn't interfer with the base class drawing).
|
|
|
|
|
Hi!
I have been making some .net controls lately which I have tried to expose as ActiveX controls. Exposing them and registering them went smooth, but now I'm trying to access them from unmanaged C++. How should I do this? I expect I'll have to define a C++ interface so the compiler knows how to interpret the pointer to the interface, but how should I make it?
|
|
|
|
|
My understanding of this is that when you expose a .NET assembly to the COM world, the compiler will generate the necessary COM interfaces for you.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Horrific Minnesota Radio
Judah Himango
|
|
|
|
|
Well... it does.. that is.. it generates the necessary code, but it doesn't generate any headers.. And I'll need a header with these definitions to use the code in C++ don't I?
|
|
|
|
|
|
Hi every body,
I want to generate a random number between 0 and 30,000. How this can be done in C#.
In C, it is like this.
int Random = rand()%30,000;
Could any one please help in this regard.
thanks a lot.
|
|
|
|
|
|
Random random = new Random();
int randomNumber=random.Next(30000);
/\ |_ E X E GG
|
|
|
|
|
Hi...
I have a richtextbox, it has about 200 lines, and i want to go to line 125 when i press a button!
I have made this code...
int count = 0;
int GoTo = 125;
for(int i = 0; i < GoTo; i++)
{
count += richTextBoxText.Lines[i].Length;
}
richTextBoxText.Select(count,0);
but this does not work.
My idea was to get all chars from the lines until it reached 125, and then go to the line using the select method.
Can anyone help me how to do go to a line in a richTextBox?
Thanks
QzRz
|
|
|
|
|
RichTextBox.Lines won't return the number of lines in the box that are due to word wrapping, but rather, it will return the number of lines due to new line breaks (Environment.NewLine) in the text.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Horrific Minnesota Radio
Judah Himango
|
|
|
|
|
I am with a problem in a program to which I am elaborating and I wait that they help me.
In the program a button will be pressured, it must send the information to the other program that keyboard key ENTER was pressured.
In this another program keyboard key ENTER has a definitive function.
This is the logic, however my only one doubts this in:
As to determine that the keyboard key was pressured, being it for the program and not for the keyboard.
|
|
|
|
|
I don't think anyone here understood your question. Could you explain it better? what do you want to do? differentiate when the Click event of the Button was raised because of the user actually clicking the button or because the user pressed the Enter key?
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Sorry my English is bad, more one day I learns to speek correctly. XDD
In the game, when pressuring keyboard key ENTER, open the Console. I have code of send information, what I need is simple, when pressuring the button in the program that I am creating, it will send the information that keyboard key ENTER was pressured, however I do not know to define that this keyboard key in specifies was pressured.
Thank you, for your attention and patience.
|
|
|
|
|
So, you want to simulate the Enter key being pressed when the user Clicks on your button?
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
|
See SendKeys.Send[^]. It't might do what you want. And be sure to take a look at the NOTE at the very botton.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
|
|
|
|
|
Thanks.
Case that it will simulate keyboard keys of number 0~10, how to make?
|
|
|
|
|
Hi!
I would like to make a custom control with a menu that drops down when the user clicks it (sort of like a combo box) - but I can't seem to find a way to make parts of the control (the drop down menu) overlap other controls like the combobox does. Any suggestions?
|
|
|
|
|
Search MSDN or codeproject, there are many articles on doing custom control drawing.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Horrific Minnesota Radio
Judah Himango
|
|
|
|
|
Yeah... I've done alot of custom control drawing, but this is a bit different since it's supposed to be able to pop up over all the other controls... I guess I'll end up using a normal control that makes sure it's topmost all the time while it's visible. The best thing would be to be able to make a custom ContextMenu (since they're able to hover over other controls)
|
|
|
|