|
Not to burst your bubble but what happens when you run the program under for example Windows XP when you've been running it under 2000? You won't get the themeing.
Sorry if my assumption is incorrect
Ed
|
|
|
|
|
i need a program that sums the number values of a nuber for example:
when i enter the number 12345 it sums numbers values 1+2+3+4+5=15..
pls help....
also tnx for ur helps
|
|
|
|
|
Loop through the characters in the string, convert each character to a number, and add them together.
---
b { font-weight: normal; }
|
|
|
|
|
Or divide with 10 until you get to zero...
num=next%10;
sum+=num;
next=next/10;
|
|
|
|
|
We won't do your homework for you. You've already received two answers with different suggestions, but if you need more help, try yourself before, and then post the code telling us what exact problem you are having.
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Salutations,
I'm doing an editor wherein I need some syntax highlighting.
Also, let it be known that I'm using Mono.
It all comes down to a rather simple question: How do I set some text to a specific color or weight?
Thanks!
- -
Regards SirErugor
|
|
|
|
|
This is a complex task, why don't you have a look at the source for SharpDevelop.
Ed
|
|
|
|
|
Is it written using Mono-libraries?
Because I don't think so and that is the single must
- -
Regards SirErugor
-- modified at 11:48 Wednesday 15th March, 2006
|
|
|
|
|
SirErugor wrote: Is it written using Mono-libraries?
Because I don't think so and that is the single must
I would think that the principles of the algorithm to determine syntax highlighting is the same regardless of the language or framework.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
I don't thinks great care has been taken to make it portable to mono however there is a port called MonoDevelop. I don't know if this runs on Windows but I'd be pretty confident that it does (at least the text editor portion) because it's written using Mono.
Ed
|
|
|
|
|
I have a mapped drive on my local machine that points to a folder on a server off site. I also have a mapped drive that points to a folder on a server on site identical to the other. In my app I am using ADOX to examine the table and columns of a database. The following code works for the database located on site, but does not work for the database off site. Does anyone know what would cause this, and what the fix would be?
<br />
ADODB.Connection CNN = new ADODB.ConnectionClass();<br />
ADOX.Catalog Cat=new ADOX.Catalog(); <br />
<br />
ConnectionString = DataObj.BuildConnectionString(DBType,"",DBFile);<br />
try<br />
{<br />
CNN.Open(ConnectionString,"","",0);<br />
Cat.ActiveConnection = CNN;<br />
}<br />
catch(Exception ex)<br />
{<br />
throw new Exceptions(ex.Message,ex);<br />
}<br />
try<br />
{<br />
foreach(ADOX.Table t in Cat.Tables)<br />
|
|
|
|
|
Flaky network?
Can you provide some more detailed information such as the exceptions which are generated, if any.
Ed
|
|
|
|
|
Hello I have made now an ToolStripNumericUpDown control. Now I want to display a Text on the left side of the ToolStripNumericUpDown. How I can do that?
At the moment the code is the following:
<br />
public class ToolStripNumericUpDownTest : ToolStripControlHost<br />
{<br />
<br />
public ToolStripNumericUpDownTest()<br />
: base(new NumericUpDown())<br />
{<br />
}<br />
<br />
private NumericUpDown NumericUpDown<br />
{<br />
get { return Control as NumericUpDown; }<br />
}<br />
<br />
public decimal Value<br />
{<br />
get { return NumericUpDown.Value; }<br />
set { NumericUpDown.Value = value; }<br />
}<br />
}<br />
<br />
Regards
Hansjörg
|
|
|
|
|
What you need to do is create your own user control that contains both a updown control and also a label control that will be to the left of the updown control. Then set the user control to a ToolStripControlHost.
Regards,
1tg46
Check out 3D Game Development with Dark Basic Professional [^]programming.
|
|
|
|
|
Hi.
I've been trying to display a context menu with the Programs menu (Start->Programs). I'm preaty sure there should be a way to call that from the system, but had no clue finding how.
any help would be apreciated.
Thanks
|
|
|
|
|
All the items within the Program folder are located in these folders (Windows 2K used as example but similar on Windows XP)
C:\Documents and Settings\user\Start Menu
C:\Documents and Settings\All Users\Start Menu
I'm afraid you'll have to enumerate these directories and create you're own menu based on those.
You can get the current user's home directory from the Environment class (Special folders).
Ed
|
|
|
|
|
Thanks.
I probably didn't explain it well enough, but what I'm looking is not to re-create the menu, but to actually call the system menu. You know, a Win32 system call that shows it. Similar to having a button on your aplication that when pressed, shuts down the computer, or closes all open aplications, or opens the start menu.
|
|
|
|
|
Just did a quick google search resulting in
SendMessage(hWnd, WM_SYSCOMMAND, SC_TASKLIST, NULL)
Where I would guess that hWnd will be the handle to the desktop. Sorry I can't be more specific but don't have the time at the moment, I can look further tomorrow if you want.
Ed
|
|
|
|
|
I found in the SqlConnection text,i can only use the absolute path like thisConnection = new SqlConnection(
@"Data Source=(local)\SQLEXPRESS;" +
@"AttachDbFilename="+@"c:\\123\12\123.mdf"+";" +
"Integrated Security=True;"+
"Pooling=False;"
but can not use the relatively like this
thisConnection = new SqlConnection(
@"Data Source=(local)\SQLEXPRESS;" +
@"AttachDbFilename="+@".\123.mdf"+";" +
"Integrated Security=True;"+
"Pooling=False;"
If i want to do like this ,how should i do??
|
|
|
|
|
I would guess that because this information is being sent off to the SQL Server process, the question the SQL Server would need to know is "relative to where"? Your application (probably what you want - but the SQL Server knows nothing about your application)? To the SQL Server installation (probably something like C:\Program Files\SQL Server\9.0\)? Or relative to something else.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
In an email breakhearts wrote: > Thank you for answer my question about why Sql can not use relatively
> path to indicate the mdf file,but i want know how to do if i can not know
> the absolute path where my mdf file place in?Only use the ini file?
You could use Directory.GetCurrentDirectory()[^] to determine the current directory of the process and use that as a starting point.
ColinMackay.net
Scottish Developers are looking for speakers for user group sessions over the next few months. Do you want to know more?
|
|
|
|
|
Hi all!
I'm writing an application to synchronize some data to a mobile device (USB stick). Before and after copying files to the device I have to find out the free space, total space and volume name on the device and use WMI for this purpose like this:
ManagementObject mo = new ManagementObject("Win32_LogicalDisk.DeviceID='"+DeviceId+"'");
mo.Get();
UInt64 free = (UInt64)mo["FreeSpace"];
UInt64 size = (UInt64)mo["Size"];
string name = mo["VolumeName"] as string; This does work and is reasonably fast before copying anything to the USB device (approx. 100-300ms).
But after copying data onto the stick, the same call to Get() takes something between 8 and 12 seconds!
I've tried with two different USB sticks and the results are almost identical.
I'm completely stumped, does anyone have an explanation (or even better a cure)?
-- modified at 7:41 Wednesday 15th March, 2006
Perhaps I should add that this happens on a Win2K system, on another machine running XP this doesn't seem to be a problem.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
I have a help button HELP. When you click it, I want when you click on it, I want it to display with a balloon similar to this:
http://priyadi.net/wp-content/clippy.png[^]
I want the balloon to be linked to the help file DynamiXHelp and when you type on something to search, it will find the item in the help file and load the file with the requested help. If no relsuts came back, it would say "Nothing found for your search".How would you do this?
In the end we're all just the same
|
|
|
|
|
Hello!
I have a very specific question and that is about how to inherit a control for example the control System.Windows.Forms.TextBox without causing the environment to delete the control when there are some compile errors. It's the same problem with any visual control that you inherit. The control is deleted as soon as you use the View Designer when there is compile error.
It's very easy to reproduce my problem. You can do it in this way.
1. Create a class called ExtTextBox like this. In my example here I have removed the namespace. But if you include namespace make sure you have access to it.
public class ExtTextBox : System.Windows.Forms.TextBox
{
public ExtTextBox() {}
}
As you can see this class ExtTextBox inherit from the ordinary components System.Windows.Forms.TextBox in the .NET framework
2. Create a windows form with any name. The default is Form1
3. Use the View Designer and create the control TextBox in the window form.
My control was called textBox1
4. Because I want the control textBox1 to be an instance of ExtTextBox I have to edit the InitializeComponent() I don't have any other idea.
Here is an extract from my windows form called Form1.
Only the interesting rows is written. Two rows are important here.
First saying that control textBox1 is of type ExtTextBox.
Second edit the InitializeComponent and say that textBox1 is an instance of ExtTextBox.
public class Form1 : Form
{
private ExtTextBox textBox1; // First saying that control textBox1 is of type ExtTextBox.
...
...
...
Private void InitializeComponent()
{
//Second edit the InitializeComponent and say that textBox1 is an instance of ExtTextBox
this.textBox1= new ExtTextBox();
...
...
...
}
}
5 Compile. Hopefully you don't get any compile errors. When you run the application only the textBox is being displayed. The problem might start even here. If you get any compile error and you use the View Designer the control named textBox1 is being deleted automatically.
6 If you don't get any compile error make a change so you get a compile error and then use the View Designer the control named textBox1 is being deleted automatically.
7 Now to my question. I can't use controls that being deleted automatically when I get compile error.
8. If I want to use inheritance on visual control how do I do. I just can't have it as it is now.
9 I just can't use inheritance in the way I do now.
10. I hope that you have a good suggestion how I should use inheritance on visual control to avoid this kind of problems.
//Tony
|
|
|
|
|
Which version of VS.NET are you using? If it's 2005 then the custom control should be available in the toolbox.
If it's 2002 or 2003 I'll try and have a look at it but I can't remember since I havn't done any dev work on them in the last 6 months or so. But I seem to remember coming across this problem. The easiest solution I seem to remember I found was to create a new project (where possible) for containing these custom controls and reference this from the application. I know this isn't as clean a solution but it was the most reliable.
Ed
|
|
|
|