|
What ????
Are u sure u want to validate a label ??
my point is that a label present data from the system
and if it is not valid it shouldent be there at all;
|
|
|
|
|
WHy would you ever want to? You can't get user input from it, so what's really going on?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I develop a dialog inherit ..Form and then make it to a DLL file. but I can not add this dialog's icon in toolbox, it said had none componets needed to add on the toolbox.
I change this class inherit in ..Controls or in System.ComponentModel then it can add a icon which like a gear wheel, but if it inherit by ..Form then it can't work.
My target want to build a dialog component like ..PrintDialog that it can show icon on toolbox and can drag to nonvisible component area.
I wonder if ..Form's designer prevent the inherit form component add as a control..., but why ..PrintDialog which inherit by ..Form can?
=== Game is power! ===
|
|
|
|
|
It is handled in the class attributes.
[ToolboxItem(true),
ToolboxBitmap(typeof(myControl), "myControl.bmp")]
public class myControl:UserControl
You need to have Default Namespace set to the namespace of your control and you have to have the bitmap in the root of your solution.
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
At first, thanks for you help.
I do what you said, it works well, the icon that can be showed on toolbox. But when I drag the icon to the designer area and then can not see it. it can not shows on 'nonvisible component area'(a bar at the bottom of designer), say nothing of 'visible area'.
(But funny is it can be selected the component at the Property card )
=== Game is power! ===
|
|
|
|
|
Haha, I found it myself.;)
Make this class attributes will be ok.
[DesignTimeVisible(true)]
[ToolboxItem(true), ToolboxBitmap(typeof(myDialog), "myDialog.bmp")]
public class myDialog : System.Windows.Forms.Form
=== Game is power! ===
|
|
|
|
|
Hi everybody,
I need your advice/help. I have to create a .NET app that implements our existing DHTML tools.
I use the AxWebBrowser to host them, but now comes the problem. Our original app used to talk to some ASP page via XMLHttp (javascript). In the .NET app the javascript in the webbrowser has to talk to my .NET methods.
To put it simple: how can the contents of an AxWebBrowser talk to its hosting environment (my .NET app)?
I thought of creating an COM object, which I put on my HTML pages, and invoke their methods from the HTML, and the COM object would then throw events that will be caught by .NET (using the mshtml to locate the object). But obviously this is not very neat, and make everything go asynchronous.
Another option would be using MsHtmHstInterop, explained somewhere on the code project, but I didn't find more articles about it, so I wonder if it is good enough.
Thank you for your help.
|
|
|
|
|
Search the articles for Interop and you should find a few articles (including mine) which should give you all that you need.
There are 10 kinds of people in the world.
Those that read binary...
...and those who don't.
|
|
|
|
|
The IE control enables you to display a webpage. When the user clicks on a link/button that takes them to another page, an event is triggered "BeforeNavigate2".
I format my URL in the webpage according to my parsing format so i can determine if i need to display it using my application forms or through standard HTML viewer.
//***** this is the code in my HTMLViewer control which wraps the IE COM control
private void AxWebBrowser1_BeforeNavigate2(object sender, DWebBrowserEvents2_BeforeNavigate2Event e)
{
NavigationInfo ni = NavigationInfo.ParseURL((string)e.uRL);
if (ni.IsInternalURL) //
{
if (NavigationRequested!=null)
{
NavigationRequested(ni); //raise event
}
e.cancel = true;
}
}
'******* code in the form which uses the HTMLViewer control and handles the NavigationRequested event
private void HtmlViewerCC1_NavigationRequested(HTMLViewerCC.NavigationInfo ni)
{
Form f = null;
switch (ni.ObjectType)
{
case ObjectTypeCodes.Users:
f = new frmUsers(ni.Value);
break;
case ObjectTypeCodes.Company:
f = new frmCompany(ni.Value);
break;
default:
throw new Exception("Not supported");
}
f.ShowDialog();
}
|
|
|
|
|
Hi all!
I have a problem, when i create a client application (C# language) to remoting the DLL (C# language) on server (thus DCOM) that is registered.
source code is below:
Type t = Type.GetTypeFromProgID("Class_Name", "Server_Address");<br />
object o = System.Activator.CreateInstance(t);<br />
Class_Name =(Class_Name) o;
Rerult:
If "Server_Address" = null then program work well.
but "Server_Address" = "localhost" or IPaddress then I received the exception:
'System.InvalidCastException': Specified cast is not valid.
Why is it? I need everyone help me soon!
Thanks very much!
sangtao
|
|
|
|
|
I'm having a problem understanding how to register Windows Shell extensions, specifically for PropertySheet extensions and their handlers.
I am not too happy with the way it's done here -
http://www.codeproject.com/cs/miscctrl/HadiPropertySheet.asp
- "Property Sheet Shell Extension in C#"
I think this can be done with PInvoke, rather than RegAsm.exe. Obviosuly, the batch file for putting the keys and appropriate GUID into the registry can be done in code (and would be less error-prone).
Also, can anyone direct me to an example in VB.NET for the same sort of thing that's described in that article? That is, a property sheet extension example.
Thanks for any help - Ian Thomas
|
|
|
|
|
Hello,
I am a newbie in Crystal Reports. I need to sort the report based on the column that the user sets in the windows form. How do I do it?
I've been googling with virtually no help
Thanks in advance.
Regards,
Zishan
|
|
|
|
|
I don't think you can tell the report to sort from your code. One solution is to build many report, one for each column which the user can choose.
<italic>Work hard, Work effectively.
|
|
|
|
|
Thanks for replying. There should be a way. I got a sample code, Its in VB, I tried it in C# but for some reason.. it doesn't work for me. Here's the code :
Dim crSortDirection As SortDirection
Dim crDatabaseFieldDefinition As DatabaseFieldDefinition
Dim crSortField As SortField
Dim iSortItem As Integer = 0
crDatabaseFieldDefinition = crReportDocument.Database.Tables(0).Fields(6)
crSortField = crReportDocument.DataDefinition.SortFields(6)
crSortField.Field = crDatabaseFieldDefinition
'crSortField.SortDirection = SortDirection.AscendingOrder
crSortField.SortDirection = SortDirection.DescendingOrder
There is no explanation available for the code. No matter what SortField I pass, it keeps throughing CrystalDecisions.CrystalReports.Engine.InvalidArgumentException -> Invalid SortNumber.
Can you explain now?
Zishan
|
|
|
|
|
Ar you sure your C# syntax is correct? In case you are passing a groupfield instead of a databaseField, use the base class:
FieldDef = new FieldDefinition ();
FieldDef = Report.Database.Tables [0].Fields [6];
Report.DataDefinition.SortFields [0].Field = FieldDef;
Absolute faith corrupts as absolutely as absolute power
Eric Hoffer
All that is necessary for the triumph of evil is that good men do nothing.
Edmund Burke
|
|
|
|
|
Same problem Can I make a stored procedure and pass the "order by" parameter? I think that's going to solve the problem. I am using Crystal Reports that comes with the VS.net 2003. How can I call a stored procedure and pass the parameter?
Many thanks.
Zishan
|
|
|
|
|
I have used crystal in a few of my apps and the way I handle sorting is by sorting the datasource ( i use a dataset as the source ). So based on a selected column by the user, sort the dataset into the desired order or load the data into the dataset by specifying the SORT keyword in the sql statement when retrieving the data.
Hope this helps.
Craigo
|
|
|
|
|
Craigo, I tried what you told me.. it is picking up all the records in the table without any order. I commented the t.SetDataSource line.. still the same result. I am not sure if this is the right way to define Data Source. Here is my code :
Report2 t = new Report2();
string Query = "Select * from Orders order by ordertype asc";
SqlComm.CommandText = Query;
SqlDataAdapter da = new SqlDataAdapter(SqlComm);
DataSet data = new DataSet();
da.Fill(data);
t.SetDataSource(data);
this.Viewer.ReportSource = t;
Zishan
|
|
|
|
|
2 Things you can try.
1) change the code where you set the datasource to :
t.SetDataSource(data.Tables[0])
2) Add the line: t.EnableSaveDataWithReport=false;
after you have set the datasource
Let me know how you get on
Craigo
|
|
|
|
|
Hey Craig, thanks a lot man.. you saved my life.. although I don't have t.EnableSaveDataWithReport property but the problem is now solved.. Thanks for your help!
Zishan
|
|
|
|
|
hi to all,
i have developped a web service in c# .net on my local machine (localhost).
then i create a c# win application and i added the web reference (on the local host) to cosume this web service and everything works fine.
how can i put the web service on the server (windows 2000 server). and then where can i add the web reference to my c# win application to cosume it.
do i have to install the .net frame work on the server and then copy my web service project on that server ?
note that all the client terminal does not have an IIS
best regards and thanks in advance
fady
|
|
|
|
|
You have to install iis to your server and deploy your service there.
Then you can add a web reference to the server
Eg: http://ipAddress/......
Regards,
charith
|
|
|
|
|
thanks to your reply charith,
do i have to install .net framework on the server or not ?
best regards,
fady
|
|
|
|
|
Hi fady
I think you have to install the framework.Not sure!
Sometimes it might work without the framework..
regards;
charith.
|
|
|
|
|
thanks charith,
i will try with the .net framework
thanks to your reply again
fady
|
|
|
|