|
You cannot bypass the proxy. Either the administrator of the proxy machine has to open up the port for you, or, you have to tunnel it through some port which the proxy keeps open. Typically, proxies keep port 80 for HTTP open. You could write a webservice that runs on a machine that has access to the port you want and then simply have your client call the webservice instead.
|
|
|
|
|
I've derived my own GradientListView class from the ListView control to try and draw a gradient background. I'm able to draw the gradient background just fine by overriding the OnPaintBackground event, but the ListView items no longer appear in the ListView. Is it an all or nothing deal?....Do I need to handle all the painting events if I override one of them? If I comment out the SetStyle command in the constructor the ListView shows the items correctly, but obviously without the gradient background.
public GradientListView()
{
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint |
ControlStyles.DoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
}
protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent)
{
PaintRectangle(this.ClientRectangle, this.BackColor, Color.Black, pevent.Graphics);
}
protected void PaintRectangle(Rectangle Rect, Color RectColor, Color RectBorderColor, Graphics g)
{
Pen LinePen = new Pen(RectBorderColor, 10);
g.DrawRectangle(LinePen, new Rectangle(Rect.X, Rect.Y, Rect.Width - 1, Rect.Height - 1));
LinePen.Dispose();
Rect = new Rectangle(Rect.X + 1, Rect.Y + 1, Rect.Width - 2, Rect.Height - 2);
SolidBrush bgBrush = new SolidBrush(RectColor);
g.FillRectangle(bgBrush, Rect);
bgBrush.Dispose();
LinearGradientBrush brush;
Rectangle BottomRect;
BottomRect = new Rectangle(Rect.X, Rect.Height-((int)(Rect.Height / 3)), Rect.Width, Rect.Height / 3);
brush = new LinearGradientBrush(
new Point(BottomRect.Width / 2, BottomRect.Top - 1),
new Point(BottomRect.Width / 2, BottomRect.Bottom),
RectColor,
ControlPaint.Dark(RectColor));
g.FillRectangle(brush, BottomRect);
brush.Dispose();
}
|
|
|
|
|
If you have the control set to OwnerDraw then it means you will draw everything.
Have no fear, though, since you can override Paint and then just call base.Paint().
See if that corrects the drawing problem.
As to your user name.....BRILLIANT!
|
|
|
|
|
Thanks for the response, unfortunately the drawing problem still persists even after overriding the OnPaint as you suggested as well as the Draw Events....see below:
class GradientListView:System.Windows.Forms.ListView
{
public GradientListView()
{
SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint |
ControlStyles.DoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);
}
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
}
protected override void OnDrawColumnHeader(DrawListViewColumnHeaderEventArgs e)
{
base.OnDrawColumnHeader(e);
}
protected override void OnDrawItem(DrawListViewItemEventArgs e)
{
base.OnDrawItem(e);
}
protected override void OnDrawSubItem(DrawListViewSubItemEventArgs e)
{
base.OnDrawSubItem(e);
}
protected override void OnPaintBackground(System.Windows.Forms.PaintEventArgs pevent)
{
PaintRectangle(this.ClientRectangle, this.BackColor, Color.Black, pevent.Graphics);
}
protected void PaintRectangle(Rectangle Rect, Color RectColor, Color RectBorderColor, Graphics g)
{
LinearGradientBrush brush;
Rectangle BottomRect;
BottomRect = new Rectangle(Rect.X, Rect.Height-((int)(Rect.Height / 2)), Rect.Width, Rect.Height / 2);
brush = new LinearGradientBrush(
Rect,
RectColor,
Color.White,
45);
g.FillRectangle(brush, Rect);
brush.Dispose();
}
}
Any other thoughts ?
-- modified at 11:43 Monday 23rd October, 2006
|
|
|
|
|
i want to pass variable from one calss "form1" to another class "form2"
|
|
|
|
|
m.m._2007 wrote: i want to pass variable from one calss "form1" to another class "form2"
Try this article[^]
|
|
|
|
|
|
First i tried to do this with following code: System.Data.DataTable.Select(System.Data.DataColumn.ColumnName + " = NULL");
but this didn't work!
so how should i modify my syntax to get the reult i want to have?
|
|
|
|
|
Try " is null" instead.
---
b { font-weight: normal; }
|
|
|
|
|
yep this is the solution!
|
|
|
|
|
I want to cancel the minimize event and instead minimize to tray....
Thanks in advice
Alocto
:-DProgramming is heaven
|
|
|
|
|
I believe this should do the trick, just use the Forms Resize event since it is called when the Form is minimised.
private void Form1_Resize(object sender, System.EventArgs e)
{
if (this.WindowState == FormWindowState.Minimized)
{
this.Visible = false;
notifyIcon1.Visible = true;
}
}
|
|
|
|
|
It just dont cancel the minimize event......
Im kinda looking for a way to stop the event because it still minimizes before hiding.....
Alocto
:-DProgramming is Heaven
|
|
|
|
|
Copy the following method into your form.
protected override void WndProc(ref Message m)
{
if (m.Msg == 0x0112)
if (((int)m.WParam & 0xFFF0) == 0xF020)
return;
base.WndProc(ref m);
}
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi everyone,
I've been having a problem when using ShowDialog (more that it doesn't do what I want it to do )
I've got a main form, from which I create a child form which I want to always be available (I use Form.Show() to show it).
Later on, the main form will then show dialog forms (using Form.ShowDialog()). The problem is that doing this causes the child form (which I want to always be available) to be blocked along with the main form, so the user can only use the new dialog form.
Is there a simple way around this? I'd prefer not to have to change using ShowDialog, because I do this all over the place. Can I just change what I do with the child form I want to always be available?
Here's a quick example piece of code which has the effect I'm trying to explain:
private void MainForm_Shown(object sender, EventArgs e)<br />
{<br />
Form alwaysAvailableChild = new Form();<br />
alwaysAvailableChild.Text = "Should be Always Available";<br />
alwaysAvailableChild.Show();<br />
<br />
Form dialog = new Form();<br />
dialog.Text = "Dialog";<br />
dialog.ShowDialog();<br />
}
Cheers in advance.
|
|
|
|
|
When you show a form with ShowDialog() you will not be able to use other forms, because the form you just showed is showed like a dialog....
Which means that other forms not will be available before the dialog is closed again...
So if you just use Show() it should not give any problems....
Hope it solved your problem..
Alocto
:-DProgramming is Heaven
|
|
|
|
|
I realise that this is an easy option to solve the problem (although I'd have to manually disable the main form myself)... but I was more wondering if there was a way to have a completely "seperate" window from the rest of the application, so that when the main window shows a dialog, my "seperate" window will be unaffected.
The reason I'm asking is that I've got my application which shows dialogs here, there, and everywhere, and now I want to add a, sort of, help window, which is always available (preferably without moving it into a seperate application).
|
|
|
|
|
I think maybe you should run your help window in a seperate thread....
Hope that solved it
Alocto
:-DProgramming is Heaven
|
|
|
|
|
Thanks... that solves it!
|
|
|
|
|
hi
i want to het hardware id (motherboard,hard,cpu and ...) . how to do ?
thanks .
|
|
|
|
|
Try using WMI to get these values. You could combine them to create a unique ID too. Microsoft has a WMI generator tool that will help with the code, you can get it here: http://www.microsoft.com/downloads/details.aspx?familyid=2CC30A64-EA15-4661-8DA4-55BBC145C30E&displaylang=en
|
|
|
|
|
got ppl know how to change form bgcolor or label fontcolor which using dropdownlist????
|
|
|
|
|
iyoko wrote: got ppl know how to change form bgcolor or label fontcolor which using dropdownlist????
Your question is a little unclear.
If you mean, change either the form background colour / label font-colour when an item is selected in a dropdownlist, the you simply need to handle one of the selection changed events (SelectedIndexChanged, SelectedValueChanged or SelectionChangeCommitted). In the event handler, you can then call a method to change the colour of the target control by setting the value of the approriate property.
|
|
|
|
|
hi
I try to write a program that can add in IE .and when I open IE it running .(windows application no web application).
I want when I right click on link in IE(or another browser)when open popup menu choose an item that I add this to popup menu .this item have runnig an external program .I don't know how can add new item in right click popup menu in IE .I search about IE programming but don't arrive anythings about this.
if you know about this , please help me.
tanks
-- modified at 4:42 Sunday 22nd October, 2006
computer
|
|
|
|
|
Hi everyone,
I wrote an java applet for smart card with eclipse(3.1) ,I wrote oncard and offcard applet and I would like use the offcard applet in visual studio .I mean I need to add the offcard applet in C#,but I don't know how can I do it because I used some type in the offcard applet that they are not known in C#(such as JCTerminal or JCard or OPApplet),If anyone knows the solution please inform me.
yours sincerely ,
Orchid.
|
|
|
|