|
Hi
Thanks for your reply but i need to control some electronic LEDs from the pc through a particular port like for example through a USB port.Since I don't have a parallel port.
Thanks
|
|
|
|
|
That is the only article that I have seen on the CodeProject that can do what you are asking, and for that matter, it will probably be the simplest since their is an attached article to the code.
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
Is there a way of changing the actual display size of the ToolstripButton Image? I am not talking about the BackgroundImage.
I can change the size of the ToolstripButton when I make ToolstripButton.AutoSize = false, but it does not matter how big I make the ToolstripButton, the Image size stays 16 x 16.
I have tried getting the Image from the ToolstripButton and change the size and put it back on the ToolstripButton, but it still stays 16 x 16. The size of the image has changed, because I tested it by displaying it in PictureBoxes before and after the resize, but on the ToolstripButton the display size does not change.
Regards.
|
|
|
|
|
This question is old, but I was looking for the same information. I finally figured it out.
Set ToolStripButton.ImageScaling = false, and ToolStripButton.AutoSize = false. Then you can use an image of any size and it won't be resized/scaled. You will be responsible to ensure that the image is the right size for your button size.
HTH.
--sk.
|
|
|
|
|
Another option is to set ToolStripButton.ImageScaling = true, and set it's containing ToolStrip controll's ImageScalingSize property to a desired size. You can, for instance, add a 48x48 image to a button, leave the button's ImageScaling property = true, and set the containing ToolStrip's ImageScalingSize property to 24x24, and the image will be scaled down to 24x24 (not the default 16x16).
You will also want to set the ToolStripButton.AutoSize property to true (otherwise, modifying the ImageScalingSize property doesn't seem to do anything.)
HTH.
--sk.
|
|
|
|
|
Set Autosize = False, set the size you want, set ImageScaling=None
|
|
|
|
|
hi!
i am developing a web base application using c#.net with SQL 2005. In my web site i am facing problem in creating Directory structure. i am confused that how to creat directory structure in web base application. I have a little idea to creat directory structure in window base application but in web base i cannot be doit. please help me if any body can. please...
Hoping for good response.
|
|
|
|
|
We have an ASP.NET forum. Using server.mappath to get the root is the only extra step you need to create directories on your server. Of course, you cannot create directories on the client with ASP.NET.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
I'm creating a simple chat application so I started programming with the user interface. Ok here's how I did my layout, I have a split container in a horizontal orientation. The panel that is above the split container has a rich textbox where output or messages pops out including the user's messages. The panel that is below the split container also a rich textbox where the user enters the message. Whenever the user has finished typing the message, they hit the ENTER key, and then the message pops out in the rich text box that is above the split container. After hitting Enter, the rich textbox(input) should be cleared out which was not a problem. Here's the problem on that textbox, after clearing rich textbox, THE I-BEAM pointer should be pointing on the FIRST LINE... well it doesn't after I clear the rich textbox it is still pointing on the second line. Is there a command that I can CONTROL the I-BEAM pointer to POINT on the first line? or is there any other way around?
|
|
|
|
|
Can you please post your code?
|
|
|
|
|
well.. i can't post the full code cause its going to eat the whole page. Anyways, here's a code snippet of what i've done on clearing the rich textbox.
richTextBoxInput.clear();
|
|
|
|
|
Hi, I am trying to convert some of my BlitzBasic code over to C# and I cant get the following statment to work?
Blitz:
If paletteRmap[i]=0 And paletteGmap[i]=0 And paletteBmap[i]=0
C#:
If (paletteRmap[best]=0 & paletteGmap[best]=0 & paletteBmap[best]=0)
Error Message
The left-hand side of an assignment must be a variable, property or indexer?
Thanks.
|
|
|
|
|
You are looking at the wrong operator for the error. The equality comparison operator in C# is ==, not =.
However, you probably want to use the regular && operator that does short-cut evaluation, instead of the & operator that always evaluates both operands, regardless if it's needed to determine the result of the operation.
if (paletteRmap[best] == 0 && paletteGmap[best] == 0 && paletteBmap[best] == 0)
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
And = &&
Or = ||
nelsonpaixao@yahoo.com.br
|
|
|
|
|
And = & (bitwise 'and')
Or = | (bitwise 'or')
AndAlso = && (logical 'and')
OrElse = || (logical 'or')
You'll get into problems replacing the bitwise 'And' and 'Or' operators with the logical && and || operators. Conversion problems from VB are caused by the fact that many VB programmers misuse 'And' and 'Or' as logical operators (they will function as non-short-circuiting logical operators, but are designed to be bitwise operators).
David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
|
|
|
|
|
I wrote a small program and finished it (or so I think. I am sure bugs will show up). I am havinf a problem though. I need to reverse the "copy to output directory" feature. I always end up with the same db each time i load.
modified on Sunday, August 10, 2008 4:26 PM
|
|
|
|
|
Right click on the file in the solution explorer and view the properties. There you can control if the file should be copied or not when you compile.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Hi all, I'm looking for just some ideas, not really specific implementation (although, if you feel like sharing that I'd be thankful).
I have a folder with a very large number of pictures (around 10,000). None of these images are particularly big (about 50 to 100KB each)
My application views these images, 5 at a time, depending on what the user chooses. To be more clear, the images are of various species of birds. For each species there can be 5 to 10 images and, in the application, when the user selects a species, it displays all the images of that species.
I'm using the filenames to identify the species and if a certain species is selected I find the applicable files from the folder by using Directory.GetFiles() matching the relevant file names.
This is the first thing I would like to change. I would imagine that a DB implementation of sorts would be more efficient. I like MySQL and have some experience with it (although not in C# seeing as I'm fairly new to C#). Would MySQL be a reasonable choice or is there anything else I should consider if I want to keep the costs of the final product minimal?
Should I save the images as BLOBs in the DB or should I rather save them to disk and save only the file names to the DB?
Secondly, and this is where I really don't have much of a clue. I would like for the images not to be accessible to the end user, ie. this idea of having a folder on disk with 10,000 images. Is there a reasonable way of putting all of the images in a single file perhaps and have the application extract it from the file as needed? The file would be bg (we're talking of up to 500MB), would that pose significant problems to the operation of my application? What might make this decision more tricky is the fact that I'd like for it to be possible and easy to add and remove images from this file at any time.
Any ideas and suggestions would be appreciated.
|
|
|
|
|
Especially considering that you don't want the files to be accessible by the end user and want to add/remove images at any time I'd go for the database solution.
You could create a thin image access layer and create several implementations that can be switched easily. Something like this:
interface ImageAccess
{
Image[] GetImagesForSpecies(string species);
AddImage(string name);
RemoveImage(string name);
AddSpecies(string name);
RemoveSpecies(string name);
}
On top of this you could create implementations based on file systems, a local database (like SQLite[^]) or a remote database (Oracle, MySQL, PostgreSQL, whatever) where you would have to specify the connection string.
The last solution would make the data changes transparent to the user, the client app wouldn't have to update itself. But the client needs to be connected to the internet.
The filesystem/local-DB solution would require some sort of update mechanism by the client application, but no internet connection would be necessary once all the data is loaded.
I would go for a DB solution (either local or remote) saving the species names and images in relations like this:
Relation species
ID | Name (varchar)
---------
1 | Species1
2 | Species2
3 | Species3
Relation images
ID | Image (BLOB) | Species (FK)
--------------------------------
1 | ... | 1
2 | ... | 1
3 | ... | 1
4 | ... | 2
5 | ... | 2
6 | ... | 3
7 | ... | 3
A nice side effect of using a local database like SQLite is that everything will be stored in a single file, not directly accessible by the user. (Although it would still be possible to extract the images using the SQLite command line tool)
hope this helps,
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Don´t use the load image from path way.
Use a database to store the images, that way only the uses that has acess to the db can see the images.
Download here some articles that show you how to store images in a db.
GoodLuck
nelsonpaixao@yahoo.com.br
|
|
|
|
|
Hi,
I've got a program which runs on computer start-up. Is there some way to detect how the program has been opened?
For example;
If the user opens the program manually (clicking on the program .exe file), it creates a messagebox that says 'foo'.
Whereas if the program is opened by the computer at start-up it outputs a messagebox that says 'bar'.
something like:
if(openedby == user){
MessageBox.Show("foo");
}else{
MessageBox.Show("bar");
}
Just a simple example with, hopefully, a simple answer!
Thanks
|
|
|
|
|
You can send a command-line argument on start up to signal whether a user has ran it or not.
ie: if i run a file like "C:\myfile.exe /startup"
you would check it like this:
bool isUser = false;
string[] args = Environment.GetCommandlineArgs();
if (args[1] == "/startup")
isUser = false;
else
isUser = true;
Don't be overcome by evil, but overcome evil with good
|
|
|
|
|
Thanks! That sounds brilliant.
I'm setting the application in the startup registry key like this:
rkStartup.SetValue("app name", Application.ExecutablePath.ToString());
can I just change it to this:
rkStartup.SetValue("app name", Application.ExecutablePath.ToString()+" /startup");
My computers old and I'm not particularly keen on restarting it to check as it will take forever
Thanks!
|
|
|
|
|
Okay, I've pretty much got it working (I've booted up my laptop to test it on).
I realised that I should surround the app name in brackets:
rkStartup.SetValue("app name", "\""+Application.ExecutablePath.ToString()+"\""+" /startup");
and it does run on start-up and does what it's supposed to do, but then it crashes It's just a 'program has stopped responding message'.. So I'm looking into that now.
|
|
|
|
|
DragenGimp wrote: and it does run on start-up and does what it's supposed to do, but then it crashes It's just a 'program has stopped responding message'.. So I'm looking into that now.
To debug, go to your project properties and click the debug tab. In the middle you see a box saying "Command line arguments:" add /startup in that box. What that does is, when you start your debugger (f5) it will start your application with that argument. Now you'll be able to see why its crashing.
Don't be overcome by evil, but overcome evil with good
|
|
|
|