|
Yes, you are right, and I also think CallContext is the better way in my solution, if HttpContext is invalid.
And thank you again for your help
|
|
|
|
|
hi,
i need to send web request to server.but i need to send request from using universal proxie servers. any one help to me. thanks in advance.
Murali.M
|
|
|
|
|
You mean send a request through a proxy? See the HttpWebRequest.Proxy property. There already is a WebProxy class that lets you specify the host, port, a list of addresses that don't require the proxy, and user credentials if logins are required. If this isn't sufficient, you'll notice that the HttpWebRequest.Proxy property is of type IWebProxy , you can implement that interface and make your own proxy. Set the proxy instance and call HttpWebRequest.GetResponse (inherited from WebRequest , so you'll have to cast the return to an HttpWebResponse for HTTP-specific properties).
-----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,
thanks for ur help.
Have A Nice Day!
|
|
|
|
|
I wish to use the Dock property, but I need a 10 pixel inset on all 4 sides.
Let's say I am creating a simple editor. I place a TextBox control on a Form, but I'd like 10 pixel insets on every side of the TextBox.
One way:
Add a panel to the form, position the panel with 10 pixel insets on all 4 sides, and Anchor to all 4 sides. Then, attach the (Dock=Fill) TextBox to the panel panel.
Is there any way to do this without using a Panel like this?
I realize that if all I was creating was a text editor, then I could just Anchor the text box to all side of the form, and position the text box correctly, but, my real application is a bit more complicated. There are several controls inside the form - including a splitter. So, I can't really use Anchor for every case.
The crux of the problem is that when using the Dock property, the child control is docked right up against the edge of its parent. I was wondering if there was a property that could buffer or inset that child control.
I'd like to avoid having to add a Panel to my application everytime I want to position something just the way I like it - while using the Dock property. How about a thick transparent border?
FormBorderStyle will not work. I am working inside the form.
I'd also like to do this same thing for controls inside the form attached to parent Panels. I see that Panel can have a BorderStyle. Is there a way I can somehow customize the actual border?
I google "custom borders in C#" or something.
Thanks,
-Luther
|
|
|
|
|
As for the docking, you could use panels, which derive from ScrollableControl which has a DockPadding property. Dock you panels, set the padding, and you can dock or anchor your controls inside those.
In regard to drawing a border, you can use simple owner-drawing by overriding OnPaint and drawing a rectangle (see the ControlPaint class for some handy helper methods), or go so far as to override WndProc and do it a little lower-level. I'd recommend the managed way for portability and ease, though!
-----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-----
|
|
|
|
|
|
lutherbaker wrote:
wow.
Heh, I think that's what we all say to Heath's posts...
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
|
|
|
|
|
The first method works, and provides my insets.
But regarding option #2, the point of the border was to "pad" the form. I do in fact, get the border to draw, but the child controls still Dock against the edges of the form, overlapping even the border I am drawing.
Should I somehow affect the Form.ClientRectangle {get;} before forwarding to base.OnPaint () so that the border I've drawn is not overlapped by child controls? Or shall I work it out by attaching child controls to a singular, centered child Panel again?
Also - what is the Form.ClipRectangle represent? The area that needs repainting? In my little app, its always 0,0,0,0. Shouldn't it be equal to the Form.ClientRectangle? It is 0,0,0,0 every time OnPaint gets called. Even when the app is completely hidden by other windows - and then pulled to the front.
Regardless, thats just neat stuff.
Thanks,
-Luther
|
|
|
|
|
You mean the PaintEventArgs.ClipRectangle ? The clipping region is the area that has been invalidated and needs repainting, yes. This will not affect the controls themselves, however (as you've noticed). In order to do that, you have to position the child controls. Changing this clipping region will have no affect, other than perhaps not painting all the invalidated regions.
As far as it being straight zeros all the time, this doesn't seem right. Try overlapping it party with another window, or opening a dialog on your app and see if the clipping region is something else. I've done quite a bit of this and have never seen an "empty" rectangle. My other suspision is that - since the default value for numeric types of which Rectangle is made is 0, that you might have some bug in your code (no offense - just meant as another possibility).
On a side note, clipping regions are often used to make non-rectangular dialogs, like Windows Media Player, RealOne, etc. Windows Layers are a better alternative but is only supported in Win2K and up and isn't as easy to program (though better in the long-run).
-----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,
SystemColors provides access to user specified system colors.
Is there such a class for user specified system fonts? IE: Message Box? Menu, Selected Items, Active Title Bar, Inactive Title Bar? Window Text?
Thanks,
-Luther
|
|
|
|
|
Control.Font uses the DEFAULT_GUI_FONT , the stock object (see GetStockObject in the PSDK) for controls, menus, etc., if available. You can get the font used specifically for menus from SystemInformation.MenuFont . As far as the caption bar fonts go, there isn't any managed way to do this.
-----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-----
|
|
|
|
|
|
Hello,
I am trying to add a feature to my text editor that will allow the user to select multiple files in an explorer window, then right click and push "open with" and select my program. However, after testing this, I've realized that only one of the selected files is actually passed as a command line argument to my program. How can I find out what other files are selected so that I can open them also?
Thanks,
Blake
|
|
|
|
|
Do you know of any programs that support this feature? I can't find any. I tried all sorts of applications.
I'm thinking it's a limitation of the OS (shell in particular) and not something you can work around.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Textpad (www.textpad.com) supports it. So do zipping utilities like winzip and winrar.
|
|
|
|
|
At least from what I can tell on my installation, Textpad doesn't really support opening multiple files with "Open with...", it creates a new menu entry (shell) for launching it.
I know Winzip and Winrar create a bunch of new shell commands as well, which is different than using "Open With...".
Are you actually selecting two files, right clicking them, selecting "Open with...", and then picking Textpad as the program and having it open both? If so, my installation doesn't do that...
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
Yes, you're correct. I was using the menu entry instead of "Open with" and I had just assumed that Textpad would work the same way when using open with as it does with it's menu entry. But apparently not.
I guess now my question would be how to make a shell entry that would work like that. Any tips on how to go about finding out what files are selected?
Thanks,
Blake
|
|
|
|
|
Take a look at this article.
(It's in C++ but I'm not sure if some of these things are even possible in C# without Interops. It will give you a good starting point.)
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
OK, I guess I'm just stupid, but. I have a C# app that I created and want to send it to someone else. What needs to be sent along (with the .exe) so they can run it.
Thanks.
Larry J. Siddens
|
|
|
|
|
Well, generally if that person has .NET framework installed on his/her machine it will works, but if your program has configuration,database files or using custom assemblies it should be shiped with exe file,so typically it is better to create Set up project for your projects and add your settings and file to it and ship installshield only,not only the exe file.
Mazy
No sig. available now.
|
|
|
|
|
1) Create an installer for your app in VS.NET
OR
2) No installer
First of all, the .NET framework should be installed on the target computer. Include dotnetfx.exe it's on the component update disk / prerequisities disk of VS.NET...
Next thing to do is to check te references. If all references are made to files of the .NET framework you don't have to include any more files. If you have used custom .NET dlls (in app directory if you have chosen copy local) or COM dlls (via interop) you should include these in your distribution (COM: dll AND interop dll files, interop files are in your app output dir, main dll can be anywhere)
greetz
*Niels Penneman*
Software/Dev Site Personal Site
|
|
|
|
|
What is the dotnetfx.exe?
Larry J. Siddens
|
|
|
|
|
That's the .NET Framework installation. Take a look here.
EDIT: Here's a more direct link.
I, for one, do not think the problem was that the band was down. I think that the problem may have been that there was a Stonehenge monument on the stage that was in danger of being crushed by a dwarf.
-David St. Hubbins
|
|
|
|
|
I am using the RegEx which needs to check for the value to be five digits before the decimal and 2 after the decimal or just five digits. and I am using
System.Text.RegularExpressions.Regex exp = new System.Text.RegularExpressions.Regex("(^\\d{0,5}.{1}\\d{1,2}$)|(^\\d{1,5}$)");
With this it's only checking if the value is five digits before decimal and 2 after but not for just 5 digits. I entered 6 digits without decimal and it did not catch the exception.
I don't know what's wrong. Any help ?
|
|
|
|
|