|
As far as I can see you should be able to create a Graphics object using the Handle of the control.
---
b { font-weight: normal; }
|
|
|
|
|
Unfortunatelly you can't.. When you make something like this :
Graphics g = Graphics.FromHdc(panel1.Handle);
It throws an exception "ArgumentException - Value does not fall within the expected range". And that's all. I have the same problem like donkaiser. I'd like to draw something on a tabControl or a panel and I don't know how.
|
|
|
|
|
I used the paint event of the tab. but my problem is that i need to update the drawing color according to my input data. how to raise the paint event again is still a mystery. I bypassed the problem with panel.invalidate() but now i have flickering problems.
Donkaiser
|
|
|
|
|
Invalidating the control is the proper way of making it redraw itself.
---
b { font-weight: normal; }
|
|
|
|
|
I try to implement double buffer but i can't get the handle of the SetStyle method
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
VS2005 give me the error saying that SetStyle and ControlStyles is not contained in the definition of the form.
how can i get the handle on this function to use on a panel to prevent flickering?
Donkaiser
|
|
|
|
|
Hi all,
Using Serial Port class in .net 2.0 i can able to connect with RS-232 only. is ther any API or way to communicate with RS-422 port...
Thanks and Regards,
Srini
|
|
|
|
|
Have you tried just using the Serial Port control to open the RS422 port.
It might work but maybe I'm thinking of RS485.
Formula 1 - Short for "F1 Racing" - named after the standard "help" key in Windows, it's a sport where participants desperately search through software help files trying to find actual documentation. It's tedious and somewhat cruel, most matches ending in a draw as no participant is able to find anything helpful. - Shog9
Ed
|
|
|
|
|
Hi Srini,
The SerialPort class in .NET 2.0 can only be used with COM ports. If your RS-422 controller uses "COM#" names and can be used with the normal Win32 API calls that you use on a COM port (GetCommState, PurgeComm, etc.), then you might be able to use it. Otherwise you'll just have to write your own wrapper around the RS-422 controller's API.
Hope this helps!
Erik
|
|
|
|
|
Hello,
I wondering how it's possible to unzip a file using C#. Simple unzip. Is it possible without third party components?
|
|
|
|
|
Natively... I don't know... But you can allway use SharpZipLib
I'm on a Fuzzy State: Between 0 an 1
|
|
|
|
|
I like use SharpZipLib[^] too. (clickity provided for your enjoyment)
Steve Maier, MCSD MCAD
|
|
|
|
|
Thanks but is there a .NET 2.0 version?
|
|
|
|
|
As other people have said there is a compression namespace and classes in .NET 2.0 now. But have you tried to download and compile the SharpZipLib with 2.0?
Steve Maier, MCSD MCAD
|
|
|
|
|
What platform are you using? 2.0 has compression built in.
|
|
|
|
|
2.0
Can you provide me with some resource please?
|
|
|
|
|
|
I am having trouble autoscaling dynamically created classes derived from UserControl in 120 DPI.
Here are the involved classes:
ClassA : UserControl
ClassB : UserControl
Dockable pane (from third-party)
In the dockable pane is object A (ClassA). ClassA.AutoScaleMode = Inherit and controls in object A are autoscaling correctly in 120 DPI. The AutoScaleFactor from the dockable pane is apparently being used to autoscale object A (which is good).
Part of ClassA's code:
ClassB B = new ClassB();
this.Controls.Add(B);
B.Dock = Dock.Fill;
B.BringToFront();
Problem: ClassB.AutoScaleMode = Inherit, but the controls in B are not autoscaling.
Any ideas?
CuePhoenix
|
|
|
|
|
Note: One way is to set ClassB.AutoScaleMode = Font. However, ClassB in my example represents the root node of a whole heirarchy of classes that use visual inheritance, so I'd have to change AutoScaleMode on each leaf class in the tree. I want to avoid that work if possible.
CuePhoenix
|
|
|
|
|
there is a function in matlab clled svd this function is writrten like that [u,s,v]=svd(a,0)
this function is used to calculate the eigenfaces and eigenvectors
plz if any one can write it in any programing language give me this code
this link illustrate wat does this function mean
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/svd.html
haitham
|
|
|
|
|
If you look on the link you provided under the "Algorithm" section, it says that the function uses a set of LAPACK functions to compute the svd. I would suggest finding a LAPACK library for your desired language. Alternatively, the Numerical Recipies series of books should also have a description and source code for the algorithm.
|
|
|
|
|
I have an application in which there is a datagrid. Within that grid is a field called PartType. I know how to make it a drop-down box that shows what is saved in the database. I know how to make the drop-down box populate with all the different PartTypes the user can choose from. What I want to do is populate the drop-down box with the PartType choices, but to have it highlight what is already in the database. How do I program this in c# for the code behind page?
|
|
|
|
|
You can use the controls collectoin od the cell, and get the dd box.
Once you have the index, you can cast the object to a dd box and use that object to set the selectedindex value.
I'm on a Fuzzy State: Between 0 an 1
|
|
|
|
|
|
Mark, thank you for the article. However, I'm doing things a bit differently and am still confused.
I don't do the EditItemTemplates. With the use of this application, there is the assumption that once it's populated it's editable.
Here is the asp code to populate the column:
<asp:TemplateColumn HeaderText="Part Type"><br />
<ItemTemplate><br />
<asp:DropDownList ID="PartType" Runat="server" DataSource = '<%# getDescriptions2 ((string)DataBinder.Eval(Container.DataItem, "PartNumber"))%>' DataTextField = "Description"><br />
</asp:DropDownList><br />
</ItemTemplate><br />
</asp:TemplateColumn>
And this is the getDescriptions2
public object getDescriptions2 (string _PartNumber)<br />
{<br />
string SQLString = "SELECT pt.Id, pt.Description, p.ID FROM PartTypes pt INNER JOIN Parts p on pt.ID = p.PartTypeID WHERE p.PartNumber = _PartNumber ORDER by Description";<br />
SqlCommand cmd = new SqlCommand();<br />
cmd.Connection = new SqlConnection(strConnectSQL);<br />
cmd.CommandText = SQLString;<br />
SqlDataAdapter adapter = new SqlDataAdapter(cmd);<br />
DataSet ds = new DataSet();<br />
adapter.Fill(ds);<br />
return ds;<br />
<br />
}
How do I within this function set the index?
-- modified at 12:17 Thursday 29th June, 2006
|
|
|
|
|
hi, i want to list first 30 records of my table in the first page, second 30 records in the second page and so on.. how can i do it by using datagridview? plz help..
|
|
|
|