|
How do I copy the bitmap, and how do I write an owner drawn button?
|
|
|
|
|
CTRL - PrintScreen and there have to be articles on owner drawn buttons on CP. You set the button to be owner drawn, then you need to handle the button's paint event and take control of drawing it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Sounds like a lot of work. Anybody know of any code out there I can use?
|
|
|
|
|
Anything wrong with this[^] one ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Nice library. Should do the trick. Thanks. Only problem is, the buttons I designed in the demo have rounded corners and the library only draws rectangular buttons. I end up either squaring off the image with the button borders or having white space fill the corners between the image and the button border. I'd like the border of the button drawn by the library to hug the outline of the image, but don't know how to do that. Don't know anything about drawing rectangles with rounded corners. Do you?
zqx3
|
|
|
|
|
zqx3 wrote: Don't know anything about drawing rectangles with rounded corners.
Will this[^] link help?
/ravi (Author, FooButton)
|
|
|
|
|
Anybody can help with me please?i have been trying this for a week...and can't find any article related to this prob...
listView1.Items.Clear();
conn.Open();
cmd.CommandText = "SELECT * FROM hardwareTable WHERE ID="+searchBox.Text;
SqlCeDataReader rdr = cmd.ExecuteReader();
ListViewItem lvi = null;
while(rdr.Read())
{
lvi = new ListViewItem(rdr.GetInt32(0).ToString());
lvi.SubItems.Add(rdr.GetString(1));
lvi.SubItems.Add(rdr.GetString(2));
lvi.SubItems.Add(rdr.GetString(3));
lvi.SubItems.Add(rdr.GetString(4));
lvi.SubItems.Add(rdr.GetString(5));
lvi.SubItems.Add(rdr.GetString(6));
lvi.SubItems.Add(rdr.GetString(7));
listView1.Items.Add(lvi);
}
listView1.Refresh();
conn.Close();
what is the problem with my CODING???it shows an error when i push my search button..
|
|
|
|
|
How do I calculate the FPS of an app? I've looked to some articles and what I find always gets me an "Infinite" FPS. EVEN with nearly 50 sprites and I know it's not infinite. Thanks in advance.
- I love D-flat!
modified on Friday, February 22, 2008 8:09 PM
|
|
|
|
|
|
Hello all,
I'm trying to make a "public" webbrowser (for an internet kiosk).
My Webbrowser works quite good, but I have a problem : I didn't find the way to block windows "calls" to other applications...
For example : if a user click on a "mailto:" hyperlink, my webbrowser will call outlook express application !
I don't want user to be able to use another application ! Is that possible ?
I was thinking on catching a special windows message (WM_ActivateApp ??)... but don't think it's the better way.
If someone as any idea, don't hesitate to answer this message.
Thank you for your help
Ric
|
|
|
|
|
Look at navigating event of the web browser control.
this.WebBrowser1.Navigating += new System.Windows.Forms.WebBrowserNavigatingEventHandler( this.WebBrowser1_Navigating );
The event get sent two parameters; normally named sender and e
(object sender, WebBrowserNavigatingEventArgs e)
e has some properties and methods. Two of the properties are "Url" and "Cancel".
If you set Cancel to true then it prevents navagation. So you can do something like the following:
if(e.Url.ToString().ToLower().StartsWith("mailto:"))
{
e.Cancel = true;
}
|
|
|
|
|
Thanks ! I'm going to try it now
|
|
|
|
|
Welcome to The Quiz Program!
You can be quizzed on any of the following operators:
1) % (modulus, or 'remainder')
2) * (multiplication)
3) / (integer division)
4) / % (integer division & modulus in a combined challenge!
Type the number of the operator that you wish to be quizzed on: 1
I will ask you to tell me the result of
A % B
What is the smallest value of A: 0
What is the largest value of A: 100
What is the smallest value of B: 40
What is the largest value of B: 50
How many times do you wish to be quizzed:
3
Ok, we're ready to go!
What is the result of 92 % 44? 4
4 is correct!
What is the result of 92 % 48? 4
Good try, but no: 92 % 48 = 44
What is the result of 18 % 47? 47
Good try, but no: 18 % 47 = 18
Thank you for using this program - have a nice day!
Press the 'Return' key to exit
Here's my code I'm stuck have no idea what to do next.
class Program
{
class DoLoop
{
public static void Main()
{
string myChoice;
do
{
// Print A Menu
Console.WriteLine("Welcome to The Quiz Program!\n You can be quizzed on any of the following operators:");
Console.WriteLine("1) % (modulus, or 'remainder')");
Console.WriteLine("2 (multiplication)");
Console.WriteLine("3 - (integer division)");
Console.WriteLine("4 - integer division & modulus in a combined challenge!)");
Console.WriteLine("Choice (1,2,3,or 4): ");
// Retrieve the user's choice
myChoice = Console.ReadLine();
// Make a decision based on the user's choice
switch(myChoice)
{
case "1":
Console.WriteLine("I will ask you to to tell me the result of\n A % B");
break;
|
|
|
|
|
1. Enter a loop for the appropriate number of iterations
2. Post the question
3. Get the user's input
4. Compare user input to the correct result
5. Display either correct or incorrect
6. Restart the loop Glad I could help,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
OK, you're off to a start. Look up the Random class for info on generating random numbers, then read up on for/next loops for your main loop. Ask your teacher or check your course books for more info.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Why do you have 500 "Console.WriteLine" ?? Well not quite 500 but jeze, you still have quite a few!
Use a single string,
You seem to be in a class/new to programming so I'll help you with these:
1) No need to call write line 100 time unless you need to
2) The char '\n' is bad to use in .NET unlike some other other language's the new line char '\n' doesn't get converted by the compiler to the system's correct new line format. So there is a class called "Environment" which contains a "NewLine" property (the correct way to do a '\n' in .NET) which will decode to the correct new line string.
Console.WriteLine("Welcome to The Quiz Program!{0}"
+ " You can be quizzed on any of the following operators:{0}"
+ "\t1) %\t(modulus, or 'remainder'){0}"
+ "\t2) *\t(multiplication){0}"
+ "\t3) /\t(integer division){0}"
+ "\t4) /%\t(integer division & modulus in a combined challenge!)"
+ "{0}{0}Choice (1,2,3,or 4):", Environment.NewLine);
|
|
|
|
|
Hello...
I'm using toolStripTextBox and I want to detect "Leave" from this toolStripTextBox.
Somehow, it's nor working.
I attach an event "Leave" and try to write in that toolStripTextBox and just
click another control. The event is not working...
Anybody has the same problem ?
|
|
|
|
|
Try toolStripTextBox.TextBox.Leave event.
|
|
|
|
|
It's not working...
Any other ideas ?
|
|
|
|
|
I just setup an event for myToolStripTextBox.Leave and it fires correctly. If it's not working for you, please post some code.
|
|
|
|
|
try to put the textbox under dropdown menu in toolstrip. it doesn't work anymore...
anyway, thanks for the reply. I just use another event to update my data object.
|
|
|
|
|
Hi friends..
How to dock a form like visual studio solution explorer....
|
|
|
|
|
Did you try Form.Dock = ... ?
rotter
|
|
|
|
|
Hi friend..
I am working windows based MDI application... i tried Form.dock style but it is not effective.When mouse drag enter into the form means dock style is not working... can u have any idea..U have any sample code pls send me...
|
|
|
|
|
I think you didn't mean "Dock" but "Pin/Unpin"
I have no idea on how to do this.
rotter
|
|
|
|