|
Hello,
Maybe you can work with a little trick here,
The System.Windows.Forms.Form has a property called Opacity (0% to 100%).
If you create a Form and display it over your form with opacity = 0.0 (0%).
Than setup a timer with low intervall (50ms for example).
On the timer tick you increase the opacity +0.1;
If the opacity is 1.0(100%) you can change the Image and start decreasing the opacity again till it is 0.0.
I'm sure there is a much cleaner solution.
Maybe if you inherit YourButton from Forms.Button and handle the OnPaint event.
In that you can do you painting like you whant!
Hope it helps!
All the best,
Martin.
|
|
|
|
|
Ok, I just figured out a solution for ya. You'll have to override the OnPaint to use it, of course. To see the effects, set the button's BackgroundImage to some arbitrary picture (Just for testing), then set an IMAGEPATH const to the pic to draw...
protected override void OnPaint(PaintEventArgs e)
{
base.OnPaint(e);
System.Drawing.Imaging.ImageAttributes attr = new System.Drawing.Imaging.ImageAttributes();
System.Drawing.Imaging.ColorMatrix matrix = new System.Drawing.Imaging.ColorMatrix();
matrix[3, 3] = 0.2F;
attr.SetColorMatrix(matrix);
Image img = Image.FromFile(IMAGEPATH);
e.Graphics.DrawImage(img, ClientRectangle, 0F, 0F, img.Width, img.Height, GraphicsUnit.Pixel, attr);
}
Quick explanation...
I don't know how familiar you are with transformation matrices, but graphics operations generally work with 4x4 matrices for 3D position transformations and 3D color transformations. In the case of a color one, the four rows/columns stand for R, G, B, and Alpha (Opacity).
The default matrix is an identity matrix:
1 0 0 0
0 1 0 0
0 0 1 0
0 0 0 1
And this is equivalent to multiplying each component by 1. We're changing element [3,3], the last 1, into a 0.2. This leaves R, G, and B alone, but multiplies the Alpha component by 20% before outputting it.
(Obviously, change 0.2 to any value from 0=Transparent to 1=Opaque)
|
|
|
|
|
Hi!
I want to send a SMS with an UMTS/HSDPA modem (HUAWEI Model: E220) in my C# application.
This moden is from the austrian provider T-Mobile and you can send with the attached application SMS.
Any ideas?
regards
spotl
|
|
|
|
|
First time to pose a question on this board...fairly new to C# too, so please go easy
I want to do something like this in Generics:
List<int, String[]> myList = new List<int, String[]>();
This blows up obviously...any workarounds? Thanks!
Mikeyyy
|
|
|
|
|
I don't know why, but half of the syntax didn't show:
List<int, String[]> myList = new List<int, String[]>();
|
|
|
|
|
Ignore my other reply, I assumed you didn't pass the type of element, the html formatting actually removed it.
The list can have only one type, so it would be List<int><string> myList = new List<string><int>(); or List<int><string> myList = new List<int><string>();</string></string></int></int>
If your are looking at having a KeyedList then have a look at this article[^]
|
|
|
|
|
|
If you are trying to store two items for each element in the list then you should be creating a class.
class DtoListItem
{
public int SomeInt;
public string[] SomeStringArray;
}
List<DtoListItem> myList = new List<DtoListItem>();
|
|
|
|
|
Thats because it's expecting T which is the type of element in the list. If your creating a list of strings then you should declare it as List<string><string> myList = new List<string><string>();</string></string>
|
|
|
|
|
|
Hello,
I am new to .net i develop a project in that am using C# coding. i used a MDI form in that i declar the Login form as achild to MDI. now i want to lock the MDI parent form, till i give the username and password.
In that application first the MDI parent form is invoked first then it call the login form.
Help plz .....
kethare
|
|
|
|
|
You should open the login form as a dialog rather than the child of the MDI, that way you prevent access to the controls on the MDI form.
|
|
|
|
|
Does anybody know how to create an efficient Undo/Redo Class? What are the general things I need to implement?
may your code be error free
|
|
|
|
|
There are several articles at cp so search
|
|
|
|
|
|
I need to add RADIUS server capability to a application suite I am developing. Does anybody know of a source for a library that will do this easily? Thanks.
|
|
|
|
|
A quick Google search revealed some interesting results, including this one[^].
|
|
|
|
|
I have a grid view that has a number of templated fields. The gridview is populated using a stored procedure. What I want to do is get the values in each cell in a row. But I am not getting any value from the cell. The simplified code is as shown below. Any idea why the code is not showing the value in the cell.
protected void dgPayment_RowEditing(object sender, GridViewEditEventArgs e)
{
try
{
string claimNo = dgPayment.Rows[e.NewEditIndex].Cells[3].Text;
}
catch(Exception ex)
{
ex.Message.ToString();
}
}
|
|
|
|
|
You can try the following:
Check for the Edit Control type.
Get the control
Get the value stored there.
like:
if (e.Control.GetType() == typeof(DataGridViewTextBoxEditingControl))
{
DataGridViewTextBoxEditingControl EditingControl = (DataGridViewTextBoxEditingControl)e.Control;
string claimNo = EditingControl.Text;
}
Manoj
Never Gives up
|
|
|
|
|
Thanks for the response.
However I am trying to get the values of each column in a row of a gridview.
|
|
|
|
|
Thanks Manoj.
Your suggestion works great. You have been a great resource in solving my problem.
|
|
|
|
|
Hi,
I decided to move DAL layer classes to dll. Since that, my application communicate with database very slow (one time faster, another slow).
Trying to solve that problem I'm loading dll library when application starts
AppDomain.CurrentDomain.Load("dal");
but it isn't working properly.
Could somenoe give me some suggestions?
|
|
|
|
|
I can suggest you few points:
1) Have you indexed you tables? Indexing improves performance.
2) How many connection are you using? If you are using a new connection for each call then its a bottleneck for the performance. You should use single or limited number of connections to the data base.
3) You can check you functins for passing parameters "by reference" whenever you can do.
4) In case your database is not reciding on the same PC then you can optimize your queries so that less data travels to the Application server PC
Manoj
Never Gives up
|
|
|
|
|
App was working fine before moving DAL to another assembly so I think all "connection logic" is OK.
|
|
|
|
|
I'm creating a Download Manager in C# which is now nearing completion. Can someone please inform me of how I could integrate this with Internet Explorer (and possibly even Firefox) so it automatically downloads files rather than the default downloader.
Thanks in advance,
Barguast
|
|
|
|