|
You cannot add more than one image to a picture box. You can, however, add multiple picture boxes to another control such as a panel.
The picture box control doesn't contain any functionality for moving pictures within it. You can do this yourself by watching for when the user drags the mouse, then move the picture box itself.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Is Jesus the Jewish Messiah?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
hi
codeproject is best .
i want to embedd one or more exe files in my app as resource and use it programmatically ..
how to do that ?
|
|
|
|
|
|
|
Boo! Do your own homework. The only way to become a good developer is by solving problems on your own. Do you know what companies do with people who don't do their own work...they promote them! But that's beside the point...
Josh
|
|
|
|
|
Josh Smith wrote: Do you know what companies do with people who don't do their own work...they promote them!
Oh god he is telling the truth...Take my 5
|
|
|
|
|
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.2
|
|
|
|
|
Is it possible to open Shared Memory in a C# Windows application? specifically, Shared Memory created in a C++ app using the CreateFile, CreateFileMapping API.
(& if it is possible, can I get a hint where to start looking for the "instructions"?)
|
|
|
|
|
|
I used the flwing code to focus a control. But i got nothing. why?
private void button1_Click(object sender, EventArgs e)
{
if (lst1.Items.Count > 0)
{
lst2.Items.Add(lst1.SelectedItem);
lst1.Items.Remove(lst1.SelectedItem);
}
if (lst1.CanFocus)
{
lst1.Focus();
}
}
rgds,
stephen myint
|
|
|
|
|
There is an design paradox here: To have this event, you need to click the buttom which forces the focus onto the button. If it was anywhere else, you wouldn't be able to click the button.
You don't want things stealing focus while doing various operations (like clicking, drag-and-drop, etc) anyway. You should consider another UI design instead of trying to have focus jump around on the form while performing user input.
|
|
|
|
|
Use the form's Select() method or ActiveControl property instead.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
U can use Javascript client side scripting for setting focus
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
Hello,
I want to add names coming from my database to be coupled to the Text of buttons.
The number of names is variabel (depending on grade of filtering).
So I wanted to build a loop for adding the names to the Text of the buttons.
<br />
for(i = 0; i < total; i++)
buttoni.Text = "corresponding name from tabel";<br />
The "corresponding name from tabel" is no problem, but I want the i from the for-loop to be used in the variabel name for the assignement of the text. (which you see very hard-coded in the code)
But I always get errors, no matter what i try ..
Can somebody help?
Allready thanks!
-- modified at 11:07 Wednesday 3rd May, 2006
|
|
|
|
|
What errors do you get?
Please read this
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
That doesn't really matter i think (i tried different things).
I just need a way to form a variabel with a part (button) and the content of a variabel (i), which makes button1, button2, button3, ..
The errors are like "The name 'buttoni' does not exist in the current context" but that seems pretty obvious I think ..
|
|
|
|
|
Have you tried something like:
int n = x; //x being your number of buttons
Button [] buttons = new Button[n];
//remember to create every button individually.
//so far it's just an array for holding buttons, but no individual buttons.
string [] buttonStrings = new string[n]; //or use your tabel
for(int i = 0; i < n; i++)
{
buttons[i] = new Button();
buttons[i].Text = buttonString[i];
}
-Larantz-
|
|
|
|
|
Hmm, that's not exactly what I'm looking for.
This is a sample:
<br />
int totaal = this.aanbodTableAdapter.CountFrisdranken().Value;<br />
for (int i = 0; i < totaal; i++)<br />
{<br />
button[i].Text = aanbodTableAdapter.GetFrisdranken().FindByid(i).ToString();<br />
}<br />
button[i] gives errors, also buttoni, button{i} etc.
Somebody?
|
|
|
|
|
JelleM wrote:
button[i] gives errors, also buttoni, button{i} etc.
Somebody?
button[i] is the right way to access an element of a button array. WHAT ERROR DO YOU GET!!! Copy/paste it out of the IDE.
|
|
|
|
|
I don't really understand what you mean ..
I haven't got an array, only seperate buttons which are created in the design-mode with names like button1, button2, etc.
|
|
|
|
|
If you know the names of the buttons then all you have to do is write a switch (or if/else) block and set the Text property of the button you wish (inside the loop).
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Yeah, that would be the most obvious, but ..
If I have 50 buttons which have to get a name, it's quiet a job to write the code, and it's also a lot of useless code, because it would be much nicer/easier/etc. with just a loop.
+ the fact that you don't know how much buttons must be named ..
|
|
|
|
|
Loop through the forms control array, check each controls name. Im writing this in the forum so i'll need typo fixed.
for (i = 1; i <10; I++)
if (controls[i].name = "button" +i.ToString() )
controls[i].Text = "blah"
|
|
|
|
|
This sounds like the type of thing that people do in scripted languages, such as JavaScript. If that is where you are coming from, it's time to abandon that way of thinking because strongly typed (static) languages don't dance that funky jig.
What you could do is create a method like this:
public Button GetButtonByText( string text );
and make it search through the Controls on the form/page looking for a button with the specified text. But that is hacky and crass. You're much better off doing what the other replies mentioned: put the buttons into an array and index into it via the loop index.
Josh
|
|
|
|
|
It was just an idea how to solve my problem (it seemed logical to me)
But I didn't really get the array-thing, can you explain it in code?
ALlready great thanks!
|
|
|
|