|
I am using Visual c++ NET 2005
In each forms I write down the path of Icon property.
When I load the program, the Icon appear on the left corner of Title bar but in left side of menu bar appears the default icon. I do no where to change this . I need that appears in menu bar a new icon instead of the default.
I need your help.
|
|
|
|
|
You need to set the Image property of the menuitem ![Rose | [Rose]](https://codeproject.global.ssl.fastly.net/script/Forums/Images/rose.gif)
|
|
|
|
|
i have to create dynamic numbers of timers in vb.net , how can i approch it... 
|
|
|
|
|
By dynamic I assume: an unknown amount of timers need to be created during runtime. With that assumption, you will have to have a loop and collection that will store Timer objects. The following is C# pseudocode that may help with clarifying your thoughts:
Collection<timer> colTimersNeeded=new Collection<timer>
for(int i=0;i<amountneeded;>{
Timer t=new Timer();
t.Enabled=true;
...set other timer settings including duration, etc...
t.Tick+=delegate
{
...this is an anonymous method (I am not sure if their is such a thing in VB, if not you can still create a delegate here that will point to another method with proper parameters through EventHandlers). Add what needs to happen in this method....
}
}
Regards,
Thomas Stockwell
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.
Visit my Blog
|
|
|
|
|
Hi
I have a System.Windows.Forms.TreeView, but I only want to show the checkboxes on som of my nodes!
The ShowCheckBox property exists on TreeNodes for System.Web.UI.WebControls.Treeview, but not on System.Windows.Forms.TreeView.
How do I obtain the same functionality for TreeNodes on System.Windows.Forms.TreeView?
Regards
Troels Timm
|
|
|
|
|
Sorry, did not understand your question correctly.
troelstimm wrote: but I only want to show the checkboxes on som of my nodes!
To show nodes differently you need to use OwnerDraw. I suggest you construct a custom TreeView and add the features you need. You can find many articles here on CodeProject that have used OwnerDraw on TreeView controls for examples. Also there is small example code in the TreeView documentation on MSDN that may help.
You will likely need to to extend TreeViewNode as well so that each node can maintain it's state.
led mike
|
|
|
|
|
Hi
Sorry my mistake, not a clear question
I ONLY want the checkbox on some of my nodes, not all of them.
The reason why I refer to the Web is that it seem to be possible to show/hide the checkbox on the TreeNode class. This is is not available on the Forms.TreeNode.
So how to control showing checkboxes on TreeNodes and not on all nodes (the entire treeview)
Troels
|
|
|
|
|
Dear sir,
We are developing one windows application. In that we have Remember me & Load on startup ( check box )functionalities are there. Both working fine as individual selection. Like if i check the Remember me check box, for the next time login the login form remembered my id & pwd. if i check Load on start up check box, and if restart the system my application is automatically starts up.
problem :
both check box functionalities are not working together. i mean if i check both the check boxes. Application is automatically start up when system starts but the login form does not contain my login id & pwd.
if i check Individually both functionalities working fine.
Please help me. what should i do. To make both work together.
|
|
|
|
|
You would need to post the code that is handling your processing.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
this is the code we are using for the processing.
// for Application LOAD when we start our machine.
public static bool AutoStart {
get
{
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
string startupValue = (string)key.GetValue("VideoRep");
key.Close();
if (startupValue == null) return false; else return true;
}
set
{
RegistryKey key = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true);
if (value)
{
key.SetValue("VideoRep", "\"" + Application.ExecutablePath + "\"");
key.Close();
}
else
{
key.DeleteValue("VideoRep");
key.Close();
}
}
}
// for Remember Me Checkbox functionality.
public static string[] RememberMe
{
get
{
string uname = "";
string pword = "";
if (File.Exists(CONFIG_FILE))
{
BinaryReader binReader = new BinaryReader(File.Open(CONFIG_FILE, FileMode.Open));
try
{
// If the file is not empty, read the application settings.
if (binReader.PeekChar() != -1)
{
uname = binReader.ReadString();
pword = binReader.ReadString();
}
}
catch (Exception) { }
finally { binReader.Close(); }
}
return new string[2] { uname, pword };
}
set
{
if (File.Exists(CONFIG_FILE))
File.Delete(CONFIG_FILE);
if (value != null)
{
try
{
using (BinaryWriter binWriter = new BinaryWriter(File.Open(CONFIG_FILE, FileMode.Create)))
{
binWriter.Write(User.Username);
binWriter.Write(User.Password);
}
}
catch (Exception)
{
}
}
}
}
//checkbox checked events code
private void cbRememberMe_MouseClick(object sender, MouseEventArgs e)
{
if (User.RememberMe[0] != "") User.RememberMe = null; else User.RememberMe = new string[2] { User.Username, User.Password };
}
private void cbLoadStartup_MouseClick(object sender, MouseEventArgs e)
{
if (User.AutoStart) User.AutoStart = false; else User.AutoStart = true;
}
this is process we are doing please give me reply, what should i do to make both functionalities work together.
|
|
|
|
|
I am having the strangest problem. When I open up a form, it gives me the following error.
Warning 1 Could not find file 'C:\Program Files\Microsoft Visual Studio 8\Common7\IDE\yeshivot.mdb'
It is important to note that my app is working ok, but that the error comes when I open up the form in Visual Studio which. Now I went into the config file, and it says that it is pulling the file from datadirectory which I guess stumps me. I did see that the directory does exist, and that I could put the file in there and forget about it. However to me that would just seem like not really dealing with the problem. Where is DataDirectory defined? Why isn't it the directory where my app is being developed? And one more thing that is perhaps the most strange of all is that I don't own Visual Studio 8. I am using 2005.
Please enlighten me someone.
|
|
|
|
|
bfis108137 wrote: And one more thing that is perhaps the most strange of all is that I don't own Visual Studio 8. I am using 2005.
VS2005 is Visual Studio 8. On the Help menu choose the last menu entry "About Microsoft Visual Studio".
led mike
|
|
|
|
|
I guess you are right but that doesn't help me with that issue I was dealing with. I have however cheated and copied the database to that location and it works now. I would like some clarity on why my database needs to be there and not in the app folder.
|
|
|
|
|
I am trying to populate the drowdown list of a combobox in the dropdown event with the list of sqlserver but when i click the dropdown button the list populates, shows briefly and then closes.
What can i do to prevent this from happening.
Please help.
I tryied with this code but no luck.
private List<string> GetSqlServers()
{
List<string> resultList = new List<string>();
DataTable dtServers = SqlDataSourceEnumerator.Instance.GetDataSources();
foreach (DataRow row in dtServers.Rows)
{
if (row["InstanceName"] != DBNull.Value)
resultList.Add(row["ServerName"].ToString() + "\\" + row["InstanceName"].ToString());
else
resultList.Add(row["ServerName"].ToString());
}
return resultList;
}
private void cmbServers_DropDown(object sender, EventArgs e)
{
if (cmbServers.Items.Count == 0)
{
cmbServers.Items.Clear();
cmbServers.Items.AddRange(GetSqlServers().ToArray());
}
}</string></string></string>
|
|
|
|
|
Have you ever heard of DataBinding? I suggest you do some reading on the subject. I would bet there are many articles here on CodeProject covering that subject like this one for example[^]. Look in the "CHAPTERS" items on the site menu.
led mike
|
|
|
|
|
My problem is that SqlDataSourceEnumerator.Instance.GetDataSources(); return a DataTable with more than one column.
I want to show to the user [ServerName] if [InstanceName] is null or
[ServerName]\[InstanceName] if not.
That is why i didn't use data binding.
Ok i can bind the result of GetSqlServers() method in the dropdown event of the combobox but my initial problem does not dissapear.
I want it to populate in the dropdown event because it takes a long time and i don't want it to run unless the user clicks dropdown otherwise he can just edit the server name in the combobox.
The problem is that after the list is populated it is automatically closed. How can i prevent that to happen.
Please help.
|
|
|
|
|
Hai,
Plz help with my doubt.
I have a datagrid (17 columns) used for inserting datas to the database thru datasource and xmlschemas.
while editing i use the same datagrid to diplay the datas from the database got after selecting the employee id.But the problem is the already exixting columns in the datagrid doesnot hide and the datas come after the 17 columns.
how this can be achieved??????
|
|
|
|
|
Hi,
Use the Clear property to clear the Columns of the DataGrid before repopulating the Grid.
this.dataGridView1.Columns.Clear();
Hope this would be helpful.
John Adams
ComponentOne LLC.
www.componentone.com
|
|
|
|
|
Hello,
I have an Windows application in VB.Net 3.5.
I have an MDI form which has a set of menus. One of these menu items has a keyboard shortcut (Ctrl+F). When I run the form stand-alone, the keyboard shortcut works just fine.
I integrated this form into an Explorer-type form (the MDI form is launched after double-clicking a line item in a list) and the keyboard shortcut does not work now.
Can anyone help me understand why this doesn't work?
Thanks,
Joe
|
|
|
|
|
Make sure you have the parent [and possibly child form][s] KeyPreview property set to true.
Regards,
Thomas Stockwell
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.
Visit my Blog
|
|
|
|
|
I just tried that. I hear a windows tone, meaning that the key command is being processing by the child form, but the menu command in the MDI is not executing. How can the child pass the keystroke to the MDI?
Joe
|
|
|
|
|
Hi,
Currently I have developed a service.It is working fine.
Now I want to Implement thread synchronization using Mutex.
Iam very new to threading concept..I unable to do that
Kindly help me in doing the same
|
|
|
|
|
Before getting too far in answering your questions, what have you read/learned so far on threading? How much do you understand so far on mutexes, semaphores, deadlocks, and race conditions? As you are new to threading, try to come up with a 1-line description of each of these in your own words. I've learned the best way to understand something is to try and explain it out loud.
Before you start writing any synchronization code, I highly recommend you read up on the items I mentioned as much as possible. Thread sync problems can be a pain to debug later if you don't account for them right away. I woudl also check out the MSDN documentation on the Mutex and Semaphore classes. There's also a C# threading tutorial that has sample code for using the Mutex class. At the risk of sounding unoriginal, "Google is your friend".
Once you've read through the samples, see what you can come up with on your own and then we might be able to give you more detailed help.
Dybs
|
|
|
|
|
Hi,
I am building a class libarary project in MS VS 2005, when I deploy my application I don't want to my clients reference to my assembly or know about methods in my assemby.
Could anyone help me?
Thank a lot!
|
|
|
|
|
If I understand your question correctly: you want to prevent clients from reusing your code through referencing in their own projects.
If that is the case, then you may want to look into obfuscation (I use Spices.VSIP.Obfuscator). Obfuscation assists in preventing decompiling of projects and assists in scrambling method names so that only authorized programs can interact with them.
Regards,
Thomas Stockwell
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.
Visit my Blog
|
|
|
|