|
Just put a check to validate the user entered password with the default password. If both are same, the show the form2. Thats it..
public partial class Form1 : Form
{
Form2 form2 = new Form2();
public Form1()
{
InitializeComponent();
Password.PasswordChar = '*'; //Masking Char
}
private void Form1_Ok_Click(object sender, EventArgs e)
{
string strDefaultPassword = "ABCD"; //Keep ur default passowrd
string strEnteredPassword = Password.Text;
if(strEnteredPassword == strDefaultPassword )
{
this.hide();
form2.ShowDialog();
}
else
{
MessageBox.Show("Wrong password entered");
this.Close();
}
}
}
Thanks & Rgds,
Sri..
|
|
|
|
|
How can I add an option to the r-click menu from Windows Explorer ? Can someone help me with some info or a source-code ?
|
|
|
|
|
Search the artciles for the term "shell extension" and you should find some useful information.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi,
How to get a certain project/files based on the labels using SourceSafe SDK, I use Get method of IVSSItem to get the latest version of a project/file, but don't know how to use it for getting certain project/file on the basis of label, does any one know about that.
Warm Regards,
Mushq
|
|
|
|
|
Hi
I have a DataGridview control. I want that, when user enters in NewRow I fill some cells with default values and Focus on costum cell. But i got an Error :
(Operation is not valid because it results in a reentrant call to the SetCurrentCellAddressCore function.)
And my code :
<br />
private void dGridViewWork_RowEnter(object sender, DataGridViewCellEventArgs e)<br />
{<br />
if (e.RowIndex == dGridViewWork.Rows.Count-1)<br />
{<br />
dGridView.Rows[e.RowIndex].Cells[0].Value = "1001";<br />
dGridView.Rows[e.RowIndex].Cells[4].Value = true;<br />
dGridView.CurrentCell = dGridViewWork[1, e.RowIndex];
dGridView.BeginEdit(true);<br />
}<br />
}
An error refers to the line that Focuses on Cell[1,x].
Can you help me? Tanx.
|
|
|
|
|
I did not get what you meant by that exactly.
Still assuming that you are trying to access the row 1.
By default you can access only the 1st (0th row).
i u want to access, you need to add more rows.
else you will get error when you refer to the first row, or any cell from that row, i.e. Cell[1,x].
Still please tell me more about it.
Keshav Kamat
India
|
|
|
|
|
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.
|
|
|
|