|
thank's for link. That sure answer my question. So that my "createWindowsEx" failed. But I don't know why
|
|
|
|
|
Good Afternoon All
In VB.NET i used to have a Module. I need to Call the Main Form when the login is successfully. So this is what i deed in C# so Far in a Class, Can someone Help me on this in C#. Becaues C# does not have Modules.
using System;
using System.Collections.Generic;
using System.Text;
namespace SystemAdmin
{
class Startup
{
public void Main()
{
bool loggedIn;
frmLogin frmlogin = new frmLogin();
loggedIn = (frmlogin.ShowDialog() == DialogResult.OK);
if (loggedIn)
{
Application.Run(new frmmain());
}
}
}
}
And my Login Screen Login button is like this
String strusername = txtusername.Text;
String Password = txtpassword.Text;
int bl ;
bl = obj.Check_Login(strusername, strPassword);
if (bl == 1)
{
Me.DialogResult = Windows.Forms.DialogResult.OK;
}
else
{
MessageBox.Show("Invalid Login");
}
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
What's wrong then?? I read you code briefly but it looks fine to me...
|
|
|
|
|
The c# equivalent to Modules in VB are the static classes.
|
|
|
|
|
you need to change ...
Vuyiswa Maseko wrote: if (bl == 1)
{
Me.DialogResult = Windows.Forms.DialogResult.OK;
}
to
if (bl == 1)
{
Me.DialogResult = Windows.Forms.DialogResult.OK;
this.close();
}
as you are not closing the form so the main function can't carry on....
|
|
|
|
|
Thank you
Resolved
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
Hello everyone,
I am developing an assembly class library (DLL) and an application is using it. I made strong name sign to the DLL.
The current issue is,
- The application is built with stong name signed DLL version 1;
- When I upgrade GAC to uninstall version 1 DLL and install new version 2 DLL, and run the application again (without making the application built again with version 2 DLL), the application will crash.
Is there some solution which could make the client application automatically use the lastest version DLL without rebuild the client application? I did not change any exposed interface of the class library (I just changed some internal implementation) and I do not want to make client application rebuild to make things easier.
thanks in advance,
George
|
|
|
|
|
|
Sorry for any inconveniencet, Pete.
I think it is similar but not be the same question. It is fine we could discuss from the old one as you pointed out.
regards,
George
|
|
|
|
|
You could always try doing your own research.
Follow the bread crumbs...
Assembly Versioning[^]
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: You could always try doing your own research.
This is how he does his research. One possibility is, he's a psych student writing a thesis about online communities.
led mike
|
|
|
|
|
I am not but I know you are good at C# and C++. And a nice guy like forum.
regards,
George
|
|
|
|
|
This has been said until blue in the face, to the point I have personally stopped even bothering answering his questions.
|
|
|
|
|
I am sorry for any inconvenience, I hope you are recovered.
have a nice day,
George
|
|
|
|
|
Thanks Mark!
You mean using binding redirection or publisher policy to solve this issue?
regards,
George
|
|
|
|
|
|
Hi Mark,
The issue of binding redirection solution is, it needs to change client side app.config file. My confusion is, if we update some component, like a DLL, we can feel free to change anything about the component itself, but if we change the app.config for other component (e.g. the client who is using the DLL) is not good. Any comments?
regards,
George
|
|
|
|
|
Hi there,
I'm trying to Select All text in a text box and set to cursor position to 0.
I've tryed a few things including :
this.textBox1.SelectionStart = this.textBox1.Text.Length;
this.textBox1.SelectAll();
however this sets the cursor position to the end of the Text.
Any ideas?
Thanks
Jon
|
|
|
|
|
Try setting the SelectionStart property to 0.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks John,
But the cursor is still placed at the end of the Text..
Jon
|
|
|
|
|
This is a wierd one - but so are many things with the text box - they really need to give us a new proper .net one instead of wrapping the native one.
Anyway - this is a 'dirty' solution but it works. Places the selection point at the end and Shift + Left Arrows for every character.
private void SelectAllReverse(TextBox control)
{
if (control.TextLength > 0)
{
control.SelectionStart = control.TextLength;
for (int i = 0; i < control.TextLength; i++)
{
SendKeys.Send("+{LEFT}");
}
}
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Great - Thanks for the Tip Dave
|
|
|
|
|
Just discovered Shift + Home does the same thing so set the caret to the end and send that key combination and it will do it in one shot.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Try reversing the order of your statements so that you're highlighting first, and setting the cursor position second (the position still needs to be 0).
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Ok cheers, I'll have a further play.
Jon
|
|
|
|