|
|
I have a richTextbox and in it I just need to display some formatted text. But I don't want the user to edit it. I've set the richtextBox property to readOnly and Ok, it doesn't allow the user to enter any text. But the blinking cursor still appears in the richTextBox. Is it possible to remove that too?
I need to have a RichTextBox that displays various text (in color), but the user cannot highlight or edit the text in anyway, With a regular textbox, I can set .Enabled=False and that does exactly what I want, but with the RichTextBox, setting .Enabled=False turns the box grey, and I need it to stay on the BackGround color....labels won't do, as I need individual words to be different colors.
|
|
|
|
|
vijendra58 wrote: But the blinking cursor still appears in the richTextBox. Is it possible to remove that too?
If it were a local app, yes, using P/Invokes. Being a server-app, I'd suggest using the DrawToBitmap[^]-function and display it as an image.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Hi
I'm trying to create a custom control based on TreeView, to be used in other programs.
The control should read the disc folder structure and display it.
The control builds OK, finds the data and builds the tree items.
Trouble is, in the host program, nothing is visible.
Any help will be appreciated.
alex
'Architecture is music frozen in space.'
|
|
|
|
|
alex__b wrote: Any help will be appreciated. Since you have not given us any information about the problem, that is going top be difficult. Remember, we cannot see your screen or source code. You need to do some debugging and provide some actual details of what is happening in your code.
Use the best guess
|
|
|
|
|
Well, you're right.
It was from exasperation with not being able to make it work,
and the cause was a stupid mistake (mine to be sure).
I got it a few minutes ago.
Thank you and Sorry.
alex
'Architecture is music frozen in space.'
|
|
|
|
|
I have 3 textboxes (txtoldpassword,txtnewpassword,txtconfirmpassword)
and i want to take the data that dives a user and if a user password exists in access then i can update the user password.
i try this but it doesn't work.
private void btnSave_Click(object sender, EventArgs e)
{
if (txtOldPassword.Text.Length == 0 || txtNewPassword.Text.Length == 0 || txtConfPassword.Text.Length == 0)
{
MessageBox.Show("Please Fill all the fields.");
}
else if (txtNewPassword.Text != txtConfPassword.Text )
{
MessageBox.Show(" Please insert again your new password.");
}
else
{
OleDbConnection connect = new OleDbConnection();
connect.ConnectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Users\user\Desktop\Laiki_Trapeza_Questionnaires.accdb;Persist Security Info=False;";
connect.Open();
OleDbCommand command = new OleDbCommand();
command.Connection = connect;
command.CommandText = (@"UPDATE Users_Table SET Password= '" + txtNewPassword.Text.ToString() + "' WHERE (Password='"+txtOldPassword.Text + "')");
MessageBox.Show(" Succesfull update password!");
connect.Close();
}
}
|
|
|
|
|
You haven't really executed the query yet. call command.ExecuteNonQuery()[^] right after
command.CommantText
i.e
OleDbCommand command = new OleDbCommand();
command.Connection = connect;
command.CommandText = (@"UPDATE Users_Table SET Password= '" + txtNewPassword.Text.ToString() + "' WHERE (Password='"+txtOldPassword.Text + "')");
int rowsAffected = command.ExecuteNonQuery();
MessageBox.Show(" Succesfull update password!");
|
|
|
|
|
To add to what jibesh said - please don't do it like that! Never store passwords in clear text - it is a major security risk. There is some information on how to do it here: Password Storage: How to do it.[^]
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
|
Any particular part you don't understand?
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
Message Closed
modified 11-Mar-13 10:57am.
|
|
|
|
|
No, Run test is just an example of how to use the other two methods...
If you get an email telling you that you can catch Swine Flu from tinned pork then just delete it. It's Spam.
|
|
|
|
|
And always use parameterized queries.
And don't put the data access code in the even handler -- write a Data Access Layer.
And what if multiple users have the same password?
Plus your app will be "more professional" if the state of btnSave.Enabled is controlled by the TextBoxes.
|
|
|
|
|
I'm trying to launch a URL from my desktop app. I know I have done this before:
System.Diagnostics.Process.Start("http://www.microsoft.com");
Process hangs on this line. Is this some kind of new Windows 7 security issue? I have UAC disabled and am admin on my box.
if I type "start http://www.microsoft.com" from the cmd line, it works fine, so the browser is correctly registered and works as expected.
|
|
|
|
|
Try
System.Diagnostics.Process.Start(@"http://www.codeproject.com"); (The @-sign!)
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
The url is actually passed in from a string from the object. Dunno why it's hanging on urls. Works fine if I launch say test.doc. Opens up Word.
EDIT: is there some kind of Windows 7 security thing going on?
-- modified 8-Mar-13 15:14pm.
|
|
|
|
|
Try passing a literal pointing to codeproject. If that works, there's something wrong with the string being passed.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Figured it out. On win7 you gotta do explorer.exe as the process and the URL as the parameter.
-- modified 8-Mar-13 20:48pm.
|
|
|
|
|
Eddy Vluggen wrote: The @-sign! Forward slash is not an escape character.
Use the best guess
|
|
|
|
|
It also said to use the literal. Meant as proof that Process isn't broken
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
But it's already a literal.
Use the best guess
|
|
|
|
|
You win
|
|
|
|
|
How many points do I get?
Use the best guess
|
|
|
|
|
i want to detect mouse over on title bar or mouse out from title bar in my c# winform apps. i got a code sample which works but the problem is when i place the mouse on any area of win form then mouse leave occur and when i put mouse on title bar then right event call. actually i want that if i place my mouse on any area of form except title bar then nothing should happen.only when i will place mouse on title bar then a notification should come to me and when i will remove mouse from title to out of my form then label should display mouse out message but if remove mouse from title bar to form body then label should be blank.
here is code. just run this code and tell me what modification i should do to get my expected result. thanks
using System.Runtime.InteropServices;
public partial class Form2 : Form
{
public Form2()
{
InitializeComponent();
}
protected override void WndProc(ref Message m)
{
if (m.Msg == 0xA0)
{
TrackNcMouseLeave(this);
label1.Text = "mouse move on title bar";
}
else if (m.Msg == 0x2A2)
{
label1.Text = "mouse leave from title bar";
}
base.WndProc(ref m);
}
protected override void OnMouseLeave(EventArgs e)
{
base.OnMouseLeave(e);
}
private int previouseHeight;
private void ShowClientArea()
{
if (this.ClientSize.Height == 0)
this.ClientSize = new Size(this.ClientSize.Width, previouseHeight);
}
private void HideClientAreaIfPointerIsOut()
{
if (this.Bounds.Contains(Cursor.Position))
return;
previouseHeight = this.ClientSize.Height;
this.ClientSize = new Size(this.ClientSize.Width, 0);
}
public static void TrackNcMouseLeave(Control control)
{
TRACKMOUSEEVENT tme = new TRACKMOUSEEVENT();
tme.cbSize = (uint)Marshal.SizeOf(tme);
tme.dwFlags = 2 | 0x10;
tme.hwndTrack = control.Handle;
TrackMouseEvent(tme);
}
[DllImport("user32")]
public static extern bool TrackMouseEvent([In, Out] TRACKMOUSEEVENT lpEventTrack);
[StructLayout(LayoutKind.Sequential)]
public class TRACKMOUSEEVENT
{
public uint cbSize;
public uint dwFlags;
public IntPtr hwndTrack;
public uint dwHoverTime;
}
}
tbhattacharjee
|
|
|
|