Click here to Skip to main content
15,888,286 members
Home / Discussions / C#
   

C#

 
QuestionHow to add a ScrollBar where there is none? Pin
Megidolaon25-Feb-09 3:12
Megidolaon25-Feb-09 3:12 
AnswerRe: How to add a ScrollBar where there is none? Pin
Xmen Real 25-Feb-09 3:19
professional Xmen Real 25-Feb-09 3:19 
GeneralRe: How to add a ScrollBar where there is none? [modified] Pin
Megidolaon25-Feb-09 21:23
Megidolaon25-Feb-09 21:23 
GeneralRe: How to add a ScrollBar where there is none? Pin
Xmen Real 25-Feb-09 23:01
professional Xmen Real 25-Feb-09 23:01 
GeneralRe: How to add a ScrollBar where there is none? Pin
Megidolaon25-Feb-09 23:41
Megidolaon25-Feb-09 23:41 
GeneralRe: How to add a ScrollBar where there is none? Pin
Xmen Real 25-Feb-09 23:47
professional Xmen Real 25-Feb-09 23:47 
GeneralRe: How to add a ScrollBar where there is none? Pin
Megidolaon26-Feb-09 2:02
Megidolaon26-Feb-09 2:02 
GeneralRe: How to add a ScrollBar where there is none? Pin
Xmen Real 26-Feb-09 2:49
professional Xmen Real 26-Feb-09 2:49 
Megidolaon wrote:
So that I ensure I have only 1 PictureBox for each coordinate.In a List I could end up having with 2 PictureBoxes having the same coordiantes.

That mean you are scaring to write a little more code that will validate. Its quite simple, if you dont want to put multiple pictureboxes at same point then you can just iterate through previous pictureboxes' location. BTW I dont think you will get same point again if you try to write a good code (No need for validation) Wink | ;)



Megidolaon wrote:
When you assign the Image property of a PictureBox, you can only assign the whole image, in my case that would be the whole 256x2000 pixel source image.What I want is to split that image into 32x32 pixel tiles and assign each of these tiles to a different PictureBox, so you can click on and select each separately.Then you can paste the 32x32 tiles and build your map with them.

2000 cant be divide by 32, your image must have 2048 height if you gonna tile of 32 x 32

OoO Well, once I wrote a code similar to this but I just used a single PictureBox.
What you need to do is use the MouseClick events of PictureBox. In MouseClick, grab the cursor position, round the position to least tile position and rip it from image.

eg
Cursor Position : 35, 126
Nearest Tile Position(by rounding) : 32, 96

If you are unable to write code to round, just give a bell Wink | ;)

An advice, do not set Image in Image property, use BackgroundImage instead, therefore you can use BackgroundImageLayout and avoid lots of hassles.

TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-i’TV.C\y<pŠjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can

GeneralRe: How to add a ScrollBar where there is none? [modified] Pin
Megidolaon26-Feb-09 20:49
Megidolaon26-Feb-09 20:49 
GeneralRe: How to add a ScrollBar where there is none? Pin
Xmen Real 27-Feb-09 1:37
professional Xmen Real 27-Feb-09 1:37 
GeneralRe: How to add a ScrollBar where there is none? [modified] Pin
Megidolaon1-Mar-09 20:30
Megidolaon1-Mar-09 20:30 
GeneralRe: How to add a ScrollBar where there is none? Pin
Xmen Real 2-Mar-09 5:55
professional Xmen Real 2-Mar-09 5:55 
GeneralRe: How to add a ScrollBar where there is none? Pin
Megidolaon2-Mar-09 20:24
Megidolaon2-Mar-09 20:24 
AnswerRe: How to add a ScrollBar where there is none? Pin
Megidolaon6-Mar-09 1:11
Megidolaon6-Mar-09 1:11 
QuestionHow to Loop through this Arraylist Pin
Vimalsoft(Pty) Ltd25-Feb-09 3:03
professionalVimalsoft(Pty) Ltd25-Feb-09 3:03 
AnswerRe: How to Loop through this Arraylist Pin
Colin Angus Mackay25-Feb-09 3:14
Colin Angus Mackay25-Feb-09 3:14 
GeneralRe: How to Loop through this Arraylist Pin
Vimalsoft(Pty) Ltd25-Feb-09 3:29
professionalVimalsoft(Pty) Ltd25-Feb-09 3:29 
AnswerRe: How to Loop through this Arraylist Pin
PIEBALDconsult25-Feb-09 3:54
mvePIEBALDconsult25-Feb-09 3:54 
GeneralRe: How to Loop through this Arraylist Pin
Vimalsoft(Pty) Ltd25-Feb-09 4:05
professionalVimalsoft(Pty) Ltd25-Feb-09 4:05 
GeneralRe: How to Loop through this Arraylist Pin
PIEBALDconsult25-Feb-09 6:51
mvePIEBALDconsult25-Feb-09 6:51 
QuestionChallenge manipulating combobox selectedvalue and selectedvaluechanged Pin
highjo25-Feb-09 2:44
highjo25-Feb-09 2:44 
AnswerRe: Challenge manipulating combobox selectedvalue and selectedvaluechanged Pin
Cracked-Down25-Feb-09 3:00
Cracked-Down25-Feb-09 3:00 
AnswerRe: Challenge manipulating combobox selectedvalue and selectedvaluechanged Pin
Xmen Real 25-Feb-09 3:14
professional Xmen Real 25-Feb-09 3:14 
AnswerRe: Challenge manipulating combobox selectedvalue and selectedvaluechanged Pin
highjo25-Feb-09 7:39
highjo25-Feb-09 7:39 
GeneralRe: Challenge manipulating combobox selectedvalue and selectedvaluechanged Pin
Cracked-Down25-Feb-09 17:55
Cracked-Down25-Feb-09 17:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.