|
There is a little mistake here James,you should use singular 'FontStyle';)
Thanks again
Mazy
Don't Marry a Person You Can Live With...
Marry Someone You Can Not Live Without
|
|
|
|
|
Mazdak wrote:
you should use singular 'FontStyle'
Oh man, today isn't my day! Earlier this morning I made another mistake in the data class thread.
Maybe thats a sign that I should go to sleep!
James
Sonork ID: 100.11138 - Hasaki
"My words but a whisper -- your deafness a SHOUT.
I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
Hi All,
I am currently creating an application that needs to populate a number of arrays and then I need to be able to call them again in different parts of the application.
At the moment I have figured out how to Populate an array if I know how many items I am going to have but how do popualte and array when I don't know how many items there are.
And How do I find out how many items there are in an array once it is populated?
This is what I have at the moment
====================
string[] ClinicNames;
ClinicNames = new string[99];
int j = 0;
while (dReader.Read())
{
ClinicNames[j] = dReader.GetString(1);
j = j + 1;
}
====================
|
|
|
|
|
To find the length of an array, use the Length property:
String[] arr = new String[5];
Console.WriteLine("The array length is {0}.", arr.Length); When you exceed the capacity of your array, you will have to allocate a new array and copy the contents of the old array to the new. You can automate this process by using the System.Collections.ArrayList class which will resize the array when necessary.
--
Peter Stephens
|
|
|
|
|
OK, As I understand AxHost wrapper will allow you to embed ActiveX controls inside C# Container...
Do you know of anything that will do the contrary => allow to embed C# Sharp Control into C/C++ Container...
Thnx...
|
|
|
|
|
I read that there was support for exposing C# controls as ActiveX in early betas, but that feature was dropped before (at least) RC1. Sorry.
--
Peter Stephens
|
|
|
|
|
As I understand cumbersome case, would be to write my own wrapper...
I'm thinking that maybe idiotic, but still valid solution would be to create instance of WebBrowser, persist it with <object> tag that has dynamic CLSID of corresponding C# Object... After that enumerate DHTML and extract IDispact of that <object> element... Very possible... But, Isn't that crazy???
Strange those "young inventors" or "gurus" are forcing us to reinvent the bycicle??!!!... However, solution is there => I hope they don't have plans to rewrite WebBrowser on C# (even on C it's still pretty slow considering DHTML realtime rendering)...
Wow, what a bunc of IDIOTS!!!...
Or maybe we both don't understand something!!!...
|
|
|
|
|
Hi,
I’m trying to implement drag & drop (explorer like application) in my application using C#.
appreciate some guidance on this.
Thanks
|
|
|
|
|
After setting MdiList property to true for a main menu selection and opening several MdiChild forms, a list of child forms with the active form checked is displayed when I click on the main menu selection. How can I detect (capture) when one of the MdiChild menu selections is clicked or selected? Any help or direction would be appreciated.
Kyle
|
|
|
|
|
You need to add the following event to your parent form:
this.MdiChildActivate += new System.EventHandler(this.Form1_MdiChildActivate);
then here is the code for the handler.
private void Form1_MdiChildActivate(object sender, System.EventArgs e)
{
MessageBox.Show (this, sender.ToString());
}
HTH
|
|
|
|
|
Hi All,
This might seem a bit simple but I have been using C# to create my ASP.NET applications and it has been going okay.
Now I am trying to create a windows application and have run into a problem.
I have a form called MainForm which has a button on it, when I click this button I want my other Form 'Form2' to open up.
How do I do this?
Thanks,
|
|
|
|
|
Hi,
Using your form2 as an example;
Form2 myForm2 = new Form2();
Form2.Show();
Cheers
Paul Mason
|
|
|
|
|
|
If you want to open it as a Modal Dialog
Form2.Showdialog()
or
Form2.Show()
to open it as a form (or no modal dialog)
Remember to reference your other form.
Hope this helps.
Andres Manggini.
Buenos Aires - Argentina.
|
|
|
|
|
I am trying to port some C++ code from PC with some classes using MFC over to UNIX, I dont really want to re-write all of the MFC classes that it uses and was wondering if anyone has seen, these classes re-written in standartd c++
classes are:
CMapStringToPtr
CMapStringToString
CRect
CMapWordToPtr
CObArray
CPtrArray
CMapStringToOb
CObject
CStringList
CPtrList
CString
CMap
Clist
CArrayCInstructionList
any help with this would be greatly appreciated
michael.fellows@amsjv.com
|
|
|
|
|
Most of those are found in STL, which is what you will have to learn before porting.
Some have no direct companion, and you will have to write a port or change the code.
// Rock
|
|
|
|
|
How would I go about associating a shortcut key, say CTRL+F, with a button on a form so that the button's click event would fire when the shortcut key was hit?
|
|
|
|
|
Anyone know the code to make a program press the F1 key without touching the keyboard? In other words when I click a button I want the computer to respond as if I had pressed the F1 key. Any help would be appreciated.
Kyle
|
|
|
|
|
keybd_event(VK_F1, 0x45, 0,0);
keybd_event(VK_F1, 0x45, KEYEVENTF_KEYUP,0);
=================
Or something like that:
GL
Igor
|
|
|
|
|
Hi,
I am trying to send a list of urls to the clipboard from my app which will be caught by a download manager. I have got it to work with a single url no problem, but when I select multiple items (in a ListView) the app crashes after the first URL has been sent to the clipboard.
This is the code I am using;
public void mnuDownloadItem_Click(object sender, System.EventArgs e)
{
// Some variable declarations
int i = 0;
String sCurrentURL = "";
// This stops it crashing when the listView is empty
if (listView1.SelectedItems.Count != 0)
{
for(i=0; i < listView1.SelectedItems.Count; i++)
{
sCurrentURL = listView1.SelectedItems[i].Tag.ToString(); Clipboard.SetDataObject(sCurrentURL);
}
}
}
Would appreciate any help with this.
Thanks
Paul Mason
|
|
|
|
|
What exception is being thrown?
I see nothing wrong with your code as is; so the exception would help diagnose the problem
James
Sonork ID: 100.11138 - Hasaki
"My words but a whisper -- your deafness a SHOUT.
I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972
|
|
|
|
|
Hi,
First thanks for the reply! Secondly after some more experimenting I've found it isnt actually my application raising the exception, its external and is in the download manager (Flashget) which is catching the clipboard copies.
So Im wondering if its perhaps sending the copies too quickly for Flashget to catch them, would there be any way I can insert a short pause to test that?
Im sure its now pasting OK as I checked the last URL on the clipboard against my ListView and it matched.
Thanks Again
Paul Mason
|
|
|
|
|
Just need some advise:
I need to find possibility of converting existing pretty complicated MFC SDI Application, which is dynamic Control Container into C#?...
OK, it's enhanced version of MFC Application created by VisualStudio (MDI + Compound Document Both Container and Server + Active Document Server + Support for Compound Files + Automation + ActiveX Controls...
How and where should I start?...
Any recommendations or possibly samples??
Maybe it's wrong idea??...
Any views on that subject, please!!!
Thank you,
Igor
Happy Valentine
|
|
|
|
|
Hi guys, I'm trying to draw an icon onto the surface of a form. What I do is create the icon in the bitmap editor in VS.NET and then perform the following in my Form's code
private Icon myIcon
...
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1));
myIcon = ((System.Drawing.Icon)(resources.GetObject("icon1.ico")));
... myIcon however is always null
It's a simple matter I'm sure but I'm brain dead at the moment. How can I make sure that I have a valid icon instance in this case?
Regards
Senkwe
Just another wannabe code junky
|
|
|
|
|
Just looking at form designer generated code I get this:
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
I seems like it gets the icon out of the associated resx file.
--
Peter Stephens
|
|
|
|