|
Very simple (if you know how, of course ):
Enum.GetValues(typeof(Colors)).Length GetValues() already returns an array, so perhaps you can use this one directly instead of creating one yourself.
Regards,
mav
|
|
|
|
|
I have a customized Print Preview dialog made of a Print Preview control.
When I increase zoom property, the document inside it gets enlarged and two scroll bars appear. But when I scroll down with Vertical scroll bar, it doesn't go till the bottom and bounce back upwords if I resize(enlarge) the Dialog it self. It doesn't show the bottom of the document in any case.
More over when the dialog is compressed and the document in side the preview control is not 100 % visible widthwise, the expected horizontal scroll doesn't appear.
What is the reason for such behavior?
Please guide
|
|
|
|
|
hi
i use a requer validator to control a textbox in a web page.
it works correctly on local but when i upload it to server the validator dosnt works.
whats the problem?
thanks
|
|
|
|
|
hi
Check if all the necessary file are there in the root directory of ur application in the IIS, the important file is aspnet_client.
cheers
chettu
|
|
|
|
|
hi
i checked and copy the aspnet_client folder to host root
but the problem still exist..
|
|
|
|
|
Hi
I had the same prob and the solution i gave solved the prob..... is that only ur app is not working properly or all the app running on the IIS.
|
|
|
|
|
Hi,
I want to insert a windows media player into my PDA program.
I find that the methods used in windows application can't be used in PDA.
Any default method can be used?
Or any other approach should be used?
Please help
Regards,
RockRock
|
|
|
|
|
hi friends.
i am facing a problem.
i want to display some text in a multilined texebox. actually its a text box, displaying some status. I want to show different color text for some perticular status. i tried using the color property of the textbox, but it changes the color of the entire box.
please help.
|
|
|
|
|
Get a textbox that supports multiple colours.
Either that, or I remember doing this years back in vb4 (with extras) using subclassing to do the job. If i remember rightly i trapped the paint event, got the position for the line i wanted to colour etc and printed the new coloured text directly over the exiting one in the listbox. This worked surprisingly well especially since I only did it to piss off a mate who said making colour listboxes was the only thing he couldn't do
|
|
|
|
|
Have a look at the RichTextBox control coming with the framework.
|
|
|
|
|
how is rich text box different from the normal one?
what properties of the rich text box can i use?
|
|
|
|
|
The RichTextBox can display documents in rtf format. Create a Word document, save it as rtf and load it into the richtextbox and youll see that it is rathe rpowerful.
To understand how the text must be build to make certain formattings or colors I would suggest that you make samples of what you try to achieve in word and then look into the Rtf property.
To just change the color (and also some other properties) of specific words or lines the following way is the easiest:
1. Call the Select method to select some part of the displayed text.
2. Set the SelectionColor property to change the color of the selected text.
|
|
|
|
|
I need a way to blit, as it were, several pictures off screen and then show them as a single image on screen.
Using GDI+ or a picture box displays the images one at a time until all are displayed, but it is very slow over a network.
Is it even possible?
Thanks
|
|
|
|
|
Not sure what you mean...
What do you mean by slow network? Please try to explain your problem more detailed and also what youve tried so far.
|
|
|
|
|
Maybe an example would help here.
...
Graphics g = e.Graphics;
string[] files = Directory.GetFiles("path", "*.gif");
foreach(string file in files)
{
g.DrawImage(Image.FromFile(file), x, y, width, height);
(the x, y, width, and height variables are adjusted for each
image, so they don't draw on top of each other)
}
...
This is placed in the OnPaint method of the form. If the graphics are placed on the harddrive of the machine running it, the art appears rather quickly. But if the art is stored on a server, or on a CD, each image is shown one at a time (quite a bit slower than storing the pics on the local machine), until all images are shown.
I need a way to draw the images onto an object off screen (perhaps a Bitmap object?) and then when all of the images have finished drawing, display the finished object as a single piece of art.
I have seen examples of this using DirectDraw, but I want to do this without DirectX.
Thanks for your help.
|
|
|
|
|
Ok now I got it.
Create a bimtap which is big enough to hold all your images, get a Graphics object from it, then draw all your images into that graphics and finally draw it onto your Graphics object:
<br />
Bitmap b = new Bitmap(totalWidth, totalHeight);<br />
using (Graphics g = Graphics.FromImage(b)) {<br />
string[] files = Directory.GetFiles("path", "*.gif");<br />
foreach(string file in files)<br />
{<br />
g.DrawImage(Image.FromFile(file), x, y, width, height);<br />
}<br />
}<br />
e.Graphics.DrawImageUnscaled(0, 0);<br />
But note that the total amount of time spent for this operation will not be shorter, because neverthless reading from CD or over network will consume some time. But if needed you could cache the whole bitmap to make the next drawing faster.
|
|
|
|
|
Thank you, I will give this a try.
|
|
|
|
|
Thank you, that is exactly what I needed.
I did not expect the build time to be any different, I just didn't want to watch each of the images build on the screen.
Thanks again.
|
|
|
|
|
hi
how i can assign ENTER to a button in a web page?
( pressing ENTER : fire the button_click events )
thanks
|
|
|
|
|
|
for thisfunctionality u need to have the button to be the default button..for this set button's tabindex property to 0(zero) and see to it that no other control has its tabindex property set to "0".And if needed set the other controls tabindex property as need for navigating in taborder.
|
|
|
|
|
is there any way to do the same in windows forms ?
|
|
|
|
|
hello this is a stupid question but whats the easiest way to determine if a string contains a certain sub string?
|
|
|
|
|
IndexOf returns -1 if it's not there. Or a RegEx if you need case insensitive checking.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
One way is to use the IndexOf function
|
|
|
|