|
Hi and Tanx
Dear friend Cell[1,x] means Cell[ColumnIndex,RowIndex]. I know it's funny but when we want to set CurrentCell we first type columnindex.
For example imagine we are at Row number 6 (Last Row) and user press Enter key. DataGridView create new blank row, Now i want to set First Cell's value to 7 programmatically and automatically move cursor to Second cell, then goto input mode . But there is an Error in focussing to second cell in 'RowEnter Event'.
Please Help.
|
|
|
|
|
I am workin on Crystal Reports for VS2005
1>Can i create alerts in it,if yes how?
2>How can i read values that are assigned to formula fields in the application code?
Regards
Shaurya
|
|
|
|
|
Finally i found the solution to my problem so i am sharing the solution here.
The values that are printed on the report can be accessed from the code by this code.
CrystalDecisions.CrystalReports.Engine.ReportDocument a = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
str value=a.Rows[0][20].ToString();
The Rows property contains the data on the front page of the report.
|
|
|
|
|
Is it possible to convert a .mdb (MS Access) file to a binary file? I tried to find a solution/converter for it but was not able to do it.
Anybody got any idea?
|
|
|
|
|
LuckySmoke wrote: Is it possible to convert a .mdb (MS Access) file to a binary file?
Yes.
LuckySmoke wrote: I tried to find a solution/converter for it but was not able to do it.
You didn't say what sort of binary file. Keep in mind that an mdb file is a type of binary file too.
|
|
|
|
|
A kind of serialized, sequential-access textfile which can be used together with FileStream for example.
|
|
|
|
|
Well, that's not a binary file. Do you want to export some data to CSV?
--| "Every tool is a hammer." |--
|
|
|
|
|
Hi,
I am sending a mail through my web application. But, I want to restrict the user to "replay/replay all" to that mail which I have sent. Is it possible in C#? If yes please give me solution.
Thanks in Advance,
Reddy
rr
|
|
|
|
|
I'm not sure if that is possible except in the 2007 Microsoft Office System - Microsoft were touting that kind of functionality at their roadshow so I'm guessing it's new.
|
|
|
|
|
Hi,
How can I validate the email Address in a textbox with multiple information. The same validation in yahoo when you add email add, if email add is not correct there is an error message.
Sample. dvd@yahoo.com; exevl@hotmail.com -- > correct (semicolon)<br />
dvd@yahoo.com exevl@hotmail.com -- > correct (space)<br />
James borlan [ James@yahoo.com] -- > incorrect<br />
james@yahoo.com Donald@yahoo.com [All email] - incorrect
Thanks
Dabuskol
Dabsukol
|
|
|
|
|
|
http://regexlib.com/Search.aspx?k=ip+address
code below matchs ip
string RegString = @"^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$";
Regex RegObj = new Regex(RegString);
if (!RegObj.IsMatch(ipString))
MessageBox.Show("error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
This will match the pattern of an email address using a regex expression:
public bool EmailValid(string email)
{
string _expression = @"^([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}" +
@"\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\" +
@".)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$";
return System.Text.RegularExpressions.Regex.IsMatch( email, _expression );
}
Hope this helps
Regards
Wayne Phipps
____________
Time is the greatest teacher... unfortunately, it kills all of its students
View my Blog
|
|
|
|
|
|
Hi,
I have this code that makes the form as an MDIChild:
chartWindowController.GetForm().MdiParent =
_expertTradeMainFrm;
chartWindowController.GetForm().WindowState =
FormWindowState.Normal;
chartWindowController.GetForm().Show();
The above code snippet throws exception when Show() is called:
Message "Object reference not set to an instance of an object."
StackTrace " at System.Windows.Forms.ToolTip.CreateHandle()\r\n
at
System.Windows.Forms.ToolTip.get_Handle()\r\n at
System.Windows.Forms.ToolTip.WmWindowPosChanging(Message& m)\r\n at
System.Windows.Forms.ToolTip.WndProc(Message& msg)\r\n at
System.Windows.Forms.ToolTip.ToolTipNativeWindow.WndProc(Message& m)\r
\n
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32
msg, IntPtr wparam, IntPtr lparam)\r\n at
Microsoft.Win32.SafeNativeMethods.MessageBox(HandleRef hWnd, String
text,
String caption, Int32 type)\r\n at
System.Diagnostics.AssertWrapper.ShowMessageBoxAssert(String
stackTrace,
String message, String detailMessage)\r\n at
System.Diagnostics.DefaultTraceListener.Fail(String message, String
detailMessage)\r\n at
System.Diagnostics.DefaultTraceListener.Fail(String
message)\r\n at System.Diagnostics.TraceInternal.Fail(String
message)
\r\n
at System.Diagnostics.Debug.Fail(String message)\r\n at
CimsFramework.CimsSecurity.CmsUsrDataSheetSubModule.GetDataEntryInfo()
in
D:\\CIMS.NET\\CimsFramework\\CimsSecurity.cs:line 4127"
But when the same is not a MDIChild then it works fine i.e., if I
comment the line
chartWindowController.GetForm().MdiParent = _expertTradeMainFrm, then
the application works fine.
I have Visual Team Edition 2005 for Developers + Windows XP Sp2.
Can anyone let me know why this is happening or how to fix it. Thanks
in advance.
Regards
Sarang
|
|
|
|
|
first, make sure if one of the form-variables aren't null (expertTradeMainFrm maybe)....debug it
VirtualVoid.NET
|
|
|
|
|
I have a problem in undo & redo of custom controls...I have a custom control object that needs to be cloned into a new object when redo is done.
Am using the following method :-
In the below method "ctrl" is the New empty object to which the properties have to be copied from "propertyList"(Properties of Old object)..
But the following line throws an exception 'Unable to convert System.Reflection.RuntimePropertyInfo to System.Drawing.Point' when trying to copy AutoScrollOffset property.
lINE ->myProperty.SetValue(ctrl, obj );
Is there a way to convert a property(whatever be the type ) to the corresponding property in the new object ?????....
public static void SetControlProperties(System.Windows.Forms.Control ctrl,Hashtable propertyList)
{
PropertyDescriptorCollection properties = TypeDescriptor.GetProperties(ctrl);
foreach (PropertyDescriptor myProperty in properties)
{
if(propertyList.Contains(myProperty.Name))
{
Object obj = propertyList[myProperty.Name];
myProperty.SetValue(ctrl, obj );
}
//...
}
}
|
|
|
|
|
Hello,
PropertyDescriptorCollection pdcoldControl = TypeDescriptor.GetProperties(oldControl);
PropertyDescriptorCollection pdcnewControl = TypeDescriptor.GetProperties(newControl);
foreach(PropertyDescriptor pdoldControl in pdcoldControl)
{
if((pdoldControl.Attributes.Contains(CategoryAttribute.Appearance) && pdoldControl.IsBrowsable)
|| (pdoldControl.Attributes.Contains(CategoryAttribute.Behavior) && pdoldControl.IsBrowsable && pdoldControl.IsReadOnly==false))
{
PropertyDescriptor pdnewControl = pdcnewControl[pdoldControl.Name];
pdnewControl.SetValue(newControl,pdoldControl.GetValue(oldControl));
}
}
TypeDescriptor.Refresh(oldControl);
TypeDescriptor.Refresh(newControl);
newControl.Size = oldControl.Size;
newControl.Text = oldControl.Text;
Hope it helps!
All the best,
Martin
|
|
|
|
|
Hi,
Thanks for ur help. I have implemented your method but with this method, i am not able to clone the object along with its member variables. In order to do that, i had inserted public properties for the member variables so that i could use the suggested method to copy these properties(indirectly copying the member variables also). But one of those members is of type XMLHandler, which is a custom serializable class to read values from an XML File. when i execute the system throws an exception 'System.XML.XMLElement is not marked as serializable'.
Please help me find a way to clone the object with its member variables or fix this exception.
|
|
|
|
|
Hello,
I think you have to try to cast the object with "ISerializable" class (best way is with the "as" operator) and than ask if its "!=null".
All the best,
Martin
|
|
|
|
|
How to make a listview looks like the windows explorer?
Just look the picture at
http://goldli.s75.53dns.com/desktop.jpg
the listview item can be splited by
http://goldli.s75.53dns.com/desktop1.jpg
or
http://goldli.s75.53dns.com/desktop2.jpg
if you can not see the pictures ,please send me a mail : goldli@tom.com
|
|
|
|
|
simply, add image list with some icons, create items there (by hand in listview tasks, or programatically), columns... and groups...
VirtualVoid.NET
|
|
|
|
|
Hi,
I want to restrict copy and paste the text in a TextBox control. The user should not copy the text from TextBox control and should not Paste any text into TextBox control. The user can enter any data and can delete. How can I do this in C#?
Thanks in Advance,
Reddy.
rr
|
|
|
|
|
Hi,
Pls see this link, this should help you out.
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=741989&SiteID=1
Best regards
Omkar Ghaisas
|
|
|
|
|
Hi Reddy,
I couldn't restrict copy and paste in a textbox but colud restict copy and paste
on whole form.
here's the solution
add oncontextmenu="return false" to the body tag
Naveen G
MCSD.Net
|
|
|
|