|
If you're trying to perform lexigraphical parsing, regular expressions are not the way to go. Regular patterns are for pattern matching where a pattern is known. Linguistics is far too complex for such simple (in comparison) pattern patching.
There is plenty of material on lexicography on the Internet. I suggest you google[^].
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks,
|
|
|
|
|
Hello all. First time posting here. I am quite new to C# and was wondering how to create the Options dialog form that is used in the VS.Net IDE. The one where the TreeView is on the left and the different controls are on the right. I have a simple application I am developing and would like to incorporate this style into my app. I have not had a chance to do a thorough search of all the posts or articles yet, but what I have searched, I have not found anything on this topic.
Any help is greatly appreciated.
Thanks again!!
|
|
|
|
|
There are several articles here on CodeProject that describe such a UI, like A designable PropertyTree for VS.NET[^]. You could search for others if you like. Just use the search box toward the top of the page (right under "Bob" and The Code Project logo).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Thanks a lot, Heath! I appreciate your time. In the future I will do a more thorough search.
|
|
|
|
|
The reality is that most of the dialogs in the VS IDE are actually DHTML dialogs.
|
|
|
|
|
Is there a way to access the Statusbar (defined in the main window frmMain) from a Class (SubClass) which is called from frmMain?
eg:
in SubClass something like:
frmMain.statusbar="Hello";
Thanks!
Ariadne
|
|
|
|
|
There are several possibilties to do this.
1. You could pass the StatusBar as a parameter to the method where you need access.
2. If you need access to the StatusBar in several methods of your subclass, you could pass the StatusBar to the constructor of your subclass and store it internally.
Hope this helps a bit
|
|
|
|
|
If you declare the StatusBar field as public or internal (or protected internal), you can also cast a control's Parent form to MainForm (or whatever the class name is, not the instance name) and access the StatusBar :
MainForm form = Parent as MainForm;
if (form != null)
form.statusBar.PerformStep(); Also, it's not a "subclass", but a child class. A subclass is a class that derives from another class. A child class is a class that is a child member of another class.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
That's I'm looking for!
but what do you mean with controls Parent form?
The Statusbar is in my Main window class frmMain.
So I think I have to do something like
frmMain form = Parent as frmMain;
but then 'Parent' is unknown.
Ariadne
|
|
|
|
|
Parent is a property inheritted from Control . Any class that derives from Control inherits the Parent property, but this could be your frmMain (which, BTW, is a terrible name for a class - see Naming Guidelnes[^] in the .NET Framework SDK*), a Panel , or any container. The as keyword in C# basically performs an exception-handled cast so that it just returns null instead of throwing an InvalidCastException .
* Keeping with naming conventions within a framework or API (be it .NET, Java, MFC, etc.) is important. It fosters better development within that framework or API, among other things.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I think, i have a tiny annotation to Heaths posting.
Use a public or internal (or protected internal) Property to make your Statusbar field accessible. This allows further restriction of accessibility, for example you could make it read only.
|
|
|
|
|
Ariadne wrote:
Is there a way to access the Statusbar (defined in the main window frmMain) from a Class (SubClass) which is called from frmMain?
Hi,
I would not access the status bar object that is defined in the main window from a design perspective. Your sub-class should not really know about the status bar in the parent window. Such kind of dependency is almost always a very bad idea.
If you need to update the status bar from your control, maybe a better idey would be to use windows events.
Pankaj
Without struggle, there is no progress
|
|
|
|
|
How do I fire a windows event from my child-class?
Andreas
|
|
|
|
|
hai there,
in my application I have two three forms. Each and every form consist of more than one groupbox with four to five combo box. I am populating some record in combobox from some database(Sybase). each and every combo box in a all forms shows required records from the database.
After all compilation I will create a setup for my project. If I install this setup in any machine including my machine (where I developed my this application) my all combobox won't show any pulled data from database.
Any idea ?
Why this ? please help me .
Sreejith S S Nair
|
|
|
|
|
More than likely, it's not pulling data from the database. You should always place your connection string in the .config file so it can be easily changed. Also make sure that you're not handling any exceptions and simply ignoring them. Changes are an exception is being thrown because the connection string is wrong, doesn't exist, or your credentials are wrong when you deploy.
While this wouldn't be a problem on your machine, make sure that the OLE DB provider for Sybase is installed on the target machines. It should be, but double check. If not, you'll have to install MDAC 2.6 or higher (2.8 is the current) which includes a lot of OLE DB providers and, IIRC, Sybase is one of them.
Other than that, it's hard to say what's wrong. You should step through your code and see if any exceptions occur or if you have proper error handling (like conditionals checking for null references) that objects are null.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
i am using .config file to store connection string. And upto my level best i am catching all exception including super class(Exception class).
it won't be a problem on my machine provided on development stage. that is i can view all required data from database on development stage. After completing development if i install the created setup on the same machine it won't show any data.
if this is because MDAC i am using mdac 2.8(as you told).
i can easily setp through but the main problem is it is not showing any exception after catch all possible exception apart from super class(Exception ex).
Sreejith S S Nair
|
|
|
|
|
If you're catching all exceptions by catching Exception (the "base", not "super" class - though the concepts are the same, in .NET it's referred to as "base"), then make sure you actually do something with it, like display a MessageBox or something else. Otherwise, if you just catch it and do nothing, you'll never know if an error occured.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
catch(Exception ex)
{
MessageBox.Show("Error info :"+ex.message.toString(),"Error Message",MessageBoxButton.Ok,MessageBoxIcon.Error);
}
I am catching all exceptions professionally. the above is a small eg: to know you how i am getting information out out.
I nevar feel this much mental tension in my life. why because one product is still in shelf because of this problem.
Sreejith S S Nair
|
|
|
|
|
Actually, that's not professionally. Professional exception handling typically entails sending exception informatio to a dispatch block of sorts that is configurable and can display message boxes, raise WMI events, and much more. For example, see the Exception Management Application Block for .NET[^], part of the Microsoft Patterns and Practices initiative.
In any case, then next thing to do - as I mentioned earlier - is to step through your code in the try block and see if there isn't some other error. Without seeing your code (not just the data layer code, but also the binding code), it's impossible to tell. You need to debug your code by stepping through it and finding the error. Debugging is just part of development.
It's possible that an exception is not getting thrown but you have some conditionals that are not satisfied. Take this simple example:
SqlConnection conn = null;
SqlCommand cmd = new SqlCommdand("SELECT * FROM MyTable");
try
{
if (conn != null)
{
}
}
catch (Exception ex)
{
} This is very simple, but should describe what I'm talking about. Also, make sure that you're deploying the .config file with the application, using the same name as the app and in the same directory.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
now i got a little idea.
i already told you that all my combo box are grouped inside groupbox(actually this is for group disposal or clearing).
Now i excluded all group box.Insted of that i placed panel controls.
now i can view the data.
but the groupbox problem in still in my mind even though i got solution.
thnaks for your continous talk.
Sreejith S S Nair
|
|
|
|
|
There's no reason the GroupBox would interfere like that. I've done it many times with absolutely no problems. The GroupBox is a container control similar to the Panel . Something in your code just isn't right, but without seeing it I really can't say.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
good morning
do you want my source file to check
Sreejith S S Nair
|
|
|
|
|
Sorry, but no. I'm very busy and don't have time to go over source code, especially when the exact nature of the problem isn't known. I recommend you debug your application and step through the code to find out what's happening. Go through line by line and check the state of relevent objects as you go. Debugging is all part of the fun.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello,
i'm sorting my Xml-file with xsl. Works fine but when i want to sort my column descending, he doesn't do it. It's exactly the same as ascending. What am i doing wrong then?
XslTransform xslt = new XslTransform();
xslt.Load(xslFile, null,null);
xslt.Transform(filePath,filePath,null);
dsT.Clear();
dsT.ReadXml(filePath);
My xsl file looks like this
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()">
<xsl:sort data-type="text" select="name" order = "descending" />
</xsl:apply-templates>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
My xml file looks like this
<?xml version="1.0" encoding="utf-8"?>
<packageconfig version="1.0">
<tables>
<table name="TransMst">
<description />
<tablegroup>programs</tablegroup>
</table>
<table name="UserCmp">
<description />
<tablegroup>settings</tablegroup>
</table>
<table name="UserPrf">
<description />
<tablegroup>settings</tablegroup>
</table>
</tables>
</packageconfig>
|
|
|
|