|
try importing SendMessage win32 APi with command WM_MOUSEXXXX
If u can Dream... U can do it
|
|
|
|
|
Hi there,
I wanna change the color of the blocks present in toolstripprogressbar. The default color is green. I want to change it to some other color.How can this be made?
|
|
|
|
|
I always have the same problem.
What I do to solve it is by drawing a rectangle in a panel (and thus creating my own control)
this might help:
<br />
public void DrawProgress(ref System.Windows.Forms.Panel drawpanel, int percentage){<br />
Graphics graph = Graphics.FromHwnd(drawpanel.Handle);<br />
graph.FillRectangle(Brushes.Black, new Rectangle(0, 0, drawpanel.Width, drawpanel.Height));<br />
int rectwidth = 1;<br />
if(percentage > 0){<br />
rectwidth = (int)drawpanel.Width*percentage/100;<br />
}
Rectangle rect = new Rectangle(0, 0, rectwidth, drawpanel.Height);<br />
System.Drawing.Drawing2D.LinearGradientBrush lgbred = new System.Drawing.Drawing2D.LinearGradientBrush(rect, Color.DarkRed, Color.Red, System.Drawing.Drawing2D.LinearGradientMode.ForwardDiagonal);<br />
graph.FillRectangle(lgbred, rect);<br />
if(percentage > 0){<br />
if(percentage >= 23){<br />
graph.DrawString(percentage+"%", new Font("Arial", 12), Brushes.Black, new PointF(((int)drawpanel.Width*percentage/100)-50, 3));
}
else{<br />
graph.DrawString(percentage+"%", new Font("Arial", 12), Brushes.Red, new PointF(rect.Width+3, 3));
}
}
else{<br />
graph.DrawString("N/A", new Font("Arial", 12), Brushes.Black, new PointF(((int)drawpanel.Width*percentage/100)-50, 3));
}
}
good luck
V.
If I don't see you in this world, I'll see you in the next one... And don't be late. (Jimi Hendrix)
|
|
|
|
|
Hi V. Thanks a lot for your posting. But my project needs it to be in a progressbar only.Using paint event of toolstripprogressbar we can do that. I am trying for that.
|
|
|
|
|
private void Form1_Load(object sender, EventArgs e)
{
toolStripProgressBar1.ProgressBar.ForeColor = Color.Blue;
}
This code works for me.
|
|
|
|
|
Thanks alot vega. But it is not working with windows-xp theme. When i changed my xp-theme to someother theme. this code works. did u perform this with windows-xp theme?
|
|
|
|
|
You're correct: enabling visual styles causes this code to break. I don't know how to work around this, unfortunately.
|
|
|
|
|
i want to show/hide control in mdiparent from the code inside childform
ma_refay
|
|
|
|
|
try childform.parent.control.visible = bvisible
If u can Dream... U can do it
|
|
|
|
|
Actually the parent form's control cannot be accessed this way, you need to cast the this.MdiParent to the parent form.
MyMdiContainer frmParent = (MyMdiContainer)this.MdiParent;<br />
frmParent.ControlName.Visible = false;<br />
|
|
|
|
|
yeah , thats right(otherwise there is no suck child control in the parent window.Form class ) . But i just mean it in that code snippet..
If u can Dream... U can do it
|
|
|
|
|
hi
How to display Directory of windows in listview.
|
|
|
|
|
Directory of windows? Do you mean a list of open windows?
|
|
|
|
|
Please kindly help me how to add a ComboBox (or another window control) to a datagrid (or datagridview) when a cursor is moving over a cell needs to add this control....
Hope to your helps. Thank you.
|
|
|
|
|
pls look this link -> http://www.csharphelp.com/archives/archive279.html
If u can Dream... U can do it
|
|
|
|
|
while at runtime how we can delete that items in dropdown using c#.net while we select the one item in one dropdown box.so we have to get only few items but we have selected the ie taking properties for dropdown box adding the items in that in properties itself. but we have to disable the few items in that only we required only few items in that remaining are not be visible to customer that's it.
thanks & regards
anand m
|
|
|
|
|
In my program i need to convert Tool strip Menu item to menu item
ravi
|
|
|
|
|
hi, i have a store procedure from which i want to know the filed of dataabse table that storprocedure will act on.
i.e i want to know the parameter of store procedure.
|
|
|
|
|
Hi I'm not sure if this will answer your question entirely as I did not fully understand it. but I wrote a blog post last year sometime that helps to explain how you can get the parameters of a stored proc by using code.
Hopefully this will help in some way.
Stored Procedure discovery routine
|
|
|
|
|
hi, does anyone knows how
to set properties to folders or files
outside my application
for example ' if I want to set all windows's
folders to be transparent...
thanks
shaul
|
|
|
|
|
What exactly do you mean with 'transparant'? Dot you mean you want to set the windows folder's property to hidden or so??
|
|
|
|
|
ya, that what I mean
I know it can be done
anyone?
|
|
|
|
|
You can set a file property to hidden
create a FileInfo object (System.IO.FileInfo) and use the SetAttribute function
|
|
|
|
|
Hy,
I have Problems to use the Updater Application Block. Have anyone an an example how to use it?
Thanks
Daniel
|
|
|
|
|
Hi,
I need to know what will be effective way to track if any value changed on form in windows application other than writting text changed or selcted value chnaged event on controls.
Ritesh
Ritesh
|
|
|
|