|
Sorry. I can help you (or I could try) but I won't write code - if I write it you won't learn and if you need something again, I have to help again. But if you ask a question I will try to help you learn coding.
Regards,
Ingo
------------------------------
PROST Roleplaying Game
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
i need to draw a rectangle on the image of the picturebox control for that i used graphics drawrectangle method but it is not working properly can any body suggest other way or to use correctly the drawrectangle method
thanks in advance.
kalaveer.
|
|
|
|
|
kalaveer wrote: but it is not working properly
Define "not working properly".
Are you doing all your drawing in the Paint event?
|
|
|
|
|
What was wrong ?
I just use pictureBox and use the event Paint from pictureBox.
private void pictureBox1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
e.Graphics.DrawRectangle(new Pen(Brushes.Red, 2), 5, 5, 100, 100);
}
|
|
|
|
|
At the end of the day I shut down all my programs and then lock my computer. At around 7:00pm I have a sheduled task that runs a c# windows application. I want to add a feature to this application, that will enable it to retrieve e-mails that meet a certain criteria. The problem I am having is that once the computer is locked the program will attempt to run but will not be able to login to Outlook to retrieve the e-mails. The program is getting stuck because Outlook is asking for a Profile Name. This program runs perfectly when the computer is not locked (Outlook is also closed). Here is a sample of my code:
oApp = new Outlook.Application();
oNameSpace = oApp.GetNamespace("MAPI");
oNameSpace.Logon(null, null, true, true);
//For the above line I have even entered in my username and password
oInboxFolder =
oNameSpace.GetDefaultFolder (Outlook.OlDefaultFolders.olFolderInbox);
//The rest of the code is simply matching the criteria.
Any help in this matter would be greatly appreciated.
Thanks
Matt
|
|
|
|
|
You call "Logon" without a profile name, so Outlook tries to load the profile of the interactive user. This usually works fine, when the computer is LOCKED. It cannot work, if it is LOGGED OFF. So stay logged on to your workstation and only lock the desktop with WindowsKey+L.
Another solution would be to provide profile name and password, to start the Outlook session with the right profile. Store the password in an encrypted file to protect it from other users...
|
|
|
|
|
I have tried to logon without using a profile and it would not let me. I also tried to give it a profile name and password and again it gave me the same error. If you have done this before successfully could you post a sample of the code you used. Thanks for your time.
Matt
|
|
|
|
|
Hi guys,
I need some help, in my C# application, I am saving some settings in the registry; how do I uninstall those settings when the application is uninstalled?
Please help
sasa
|
|
|
|
|
Just a suggestion: You could set a bunch of default values for the registry keys in your install. Your C# application will override them. Then the uninstaller will pull out the registry values it created.
Logifusion[^]
If not entertaining, write your Congressman.
|
|
|
|
|
Thats a good idea; I will do that. Thanks. I still need help with deleting registry settings during uninstall though. Please help
sasa
|
|
|
|
|
I figured it out, you can do it in your setup project by going into registry properties. You can ask it to create during install, delete during uninstall, etc.
sasa
|
|
|
|
|
Hi, I created a control derived from ContainerControl and including two ComboBoxes.
When this control is put on a TabPage I execute this.BackColor = Parent.BackColor when the ParentChanged event fires. It works but the color doesnt match the parent's color. I can clearly see my controls outlines.
I don't understand why is there a difference.
|
|
|
|
|
hi all,
i placed a tabcontrol on my form. but i want to open tabs with button clicks.
so what i want is to learn how to hide or erase tabpage headers ?
this image http://link.imgshare.us/82jVCE tells what i exactly want.
help me please.
thanks in advance,
bye.
ps: there may be other ways to do this but i dont know
i want to place some buttons on the left hand side of the form and with each button click, i want to open something different (different pages) on the right hand side of that form.
i though that it can be done by tabcontrol...
i will appreciate your helps if you inform me whether there is other ways to do what i want or not?
|
|
|
|
|
You may want to consider ditching the tab control altogether and simply showing the appropriate UserControl in response to a button click.
/ravi
|
|
|
|
|
if u have allready added the tabpages to tab control at design time
then u can remove the tabpages at the time of lloading form
tabControl1.TabPages.Clear();
then on button click event u can add tab pages by this way
TabPage tb1 = new TabPage("XYZ");
tabControl1.TabPages.Add(tb1);
rahul
|
|
|
|
|
Add/Remove the TabPage s to/from the TabControl.TabPages collection as needed.
Or maybe put the controls in different Panel s or GroupBox es that are at the same position and only show the one needed.
"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
|
|
|
|
|
I think you may try another way .
i suggest you try this :
place some Panel Controls . and put your Buttons on that
on Left Buttons . you can do click even like that:
Panel1.Visible = false;
Panel2.Visible = false;
Panel3.Visible = true;
good luck - from a chinese fans
|
|
|
|
|
hi
i have access db and it has one table as "user" and 2 fields as "username" and "pass" and in user login Form in my app when input user and pass and click in enter_button the following message was shown :
Syntax error in FROM clause
my enter_button_click code is :
string str_com = "SELECT * FROM user WHERE username = '" + txt_user.Text + "' AND password = '" + txt_pass.Text + "'";
OleDbCommand command = new OleDbCommand(str_com, oleDbConnection1);
OleDbDataReader dr;
try
{
oleDbConnection1.Open();
dr = command.ExecuteReader();
if (dr.HasRows)
{
this.Hide();
Form_Main frm1 = new Form_Main();
frm1.Show();
}
else
{
MessageBox.Show("error"); }
}
finally
{
dr.Close();
oleDbConnection1.Close();
}
how to slove problem ??
thanks ..
|
|
|
|
|
"user" is a reserved word. Change the name of the table.
---
b { font-weight: normal; }
|
|
|
|
|
What does str_com expand to? Is user a reserved word in Access? Enclose the table name in square brakets like this [user]
What happens if the user types, as their user name, the following?
' OR 1=1; --
What is the code flow in that situation? What will be returned from the database if the user types that as a user name?
Your major problems are not syntax errors (because while you have syntax errors your application won't run and thus your data will be safe.) Your major problem is that your code is highly susceptable to a SQL Injection Attack (as I demonstrated above). You will likely wish to read about SQL Injection Attacks and how to prevent them.[^]
|
|
|
|
|
|
I have a Customize class that inherits a TreeView. This class has some extra properties, other than those from the TreeView. Is there a way to make this properties visible in the Properties box during design time?
|
|
|
|
|
Yes, you should insert:
[Browsable(true),
Description("..."),
Category("Design"),
DefaultValue("No Title")]
public String OwnTitle {
...
}
------------------------------
PROST Roleplaying Game
War doesn't determine who's right. War determines who's left.
|
|
|
|
|
I'm looking for a way to send a message from a desktop pc to a mobile device.
What's the easiest way to do that?
|
|
|
|
|
If you have a TCP/IP connection, then use TcpListener and TcpClient.
|
|
|
|