Hi Heath, just to let you know i finally cracked it, a combination of thinking about your posts properly and spotting a very stupid mistake i was making. Thanks a lot for your replies! Paul Griffin
Paul Griffin
Posts
-
AutoScroll Puzzle -
AutoScroll PuzzleReading that back still didn't sound right i'll try one more time. The sequence of events are as follows: 1. My panel receives focus and using the mouse wheel or scroll bar itself i scroll to some point on the panel. 2. I click on a second control e.g. a combo box. 3. I'm now finished using the combo box and i would like the panel to regain focus so that i can continue scrolling it. 4. I click back onto the panel, the panel_MouseDown event handler fires in which i include the line panel.Focus(); Problem: Each time this line is executed the panel redraws itself with the scrollbar at its initial position and i have to scroll all the way down to where i was before i can continue to the next control lower down on the panel. May sound like a trivial problem but as i've said repeatedly the functionality to set the scroll bar position explicitly doesn't seem to be there! There hope that describes the situation a bit more clearly! :) Paul Griffin
-
AutoScroll PuzzleHi Heath, sorry if i seem to be missing the point! Perhaps i need to re-phrase what it is i'm trying to accomplish. I'm trying to get a panel with AutoScroll set to true to scroll to a certain location i.e. the location last clicked before i gave focus to the panel thus causing it to redraw at its initial position. No in your example you use
this.AutoScrollPosition = p;
i assume for me this would bemypanel.AutoScrollPosition = p;
but when i do this and debug it if i step over the assignment the AutoScrollPosition value = (0,0); so i understand that i need to offset the AutoScrollPosition .. i just can't seem to get it to change from (0,0) again i appreciate your help here! this is starting to drive me mad! :) Paul Griffin -
AutoScroll PuzzleHi Heath, thanks for your response! Your suggestion is actually the way i had approached the problem. In the MouseDown event handler for my panel i create a vertical offset from the MouseEventArgs e.Y. as follows:
int offset = e.Y ; this.myPanel.Focus(); Point p = this.myPanel.AutoScrollPosition; p.Y = offset; this.myPanel.AutoScrollPosition = p;
When i debug the code i see that p does get initialised to the correct value but the assignment to AutoScrollPosition never works. AutoScrollPosition always remains (0,0)??? Any ideas as to what is happening here?? :confused: Thanks again! Paul Griffin -
AutoScroll PuzzleHi All, i've a tricky little problem with AutoScroll functionality that i can't seem to overcome. I have a panel with its autoscroll property set to true. On the panel i have several combo boxes which are surrounded by some graphics implemented with GDI+. My problem is as follows .. say a combo box at the bottom of the panel has focus, when i click on the panel i want it to gain focus but not refresh and redraw itself at its initial position i.e. (0,0). In other words when the panel gets focus i still want to be able to view the combo box at the bottom of the panel which had previously been the active control. Is there any way of preventing the panel from redrawing itself at its initial (0,0) position??? Or is it possible to calculate the autoscroll position prior to giving the panel focus then explicitly setting the autoscroll position to the desired position. Any ideas and suggestions are very welcome and appreciated! Thanks, Paul Griffin
-
MCAD certification dilemmaThanks for the thoughts guys ... now that i've got some spare time i've decided to take the plunge .. i hope to sit my first exam later this month!! Fingers crossed!! Paul Griffin
-
Graphics problems - DPI settings!!!!Hi all, i'm developing an application which involves a lot of drawing of lines and shapes, using panels as drawing surfaces. The panels themselves are on pages of a tab control. In addition the panels also contain various labels and combo boxes which are connected by the lines drawn. My problem is that if i change the system settings so that i'm running at 120dpi (instead of 96 std.) the lines and shapes get "scattered" all over the panel and no longer connect the other controls. Is there a way to detect what dpi setting a system is at and apply a transformation to my drawing routines? Any advice or suggestions are welcome Thanks Paul Griffin
-
MCAD certification dilemmaHi all, i'm recently graduated software engineer (15 months) working for an electronics company. In order to complete a recent project i started looking into .Net and c#. After 6 months i've now completed my first production level .Net application and in doing so have developed a keen interest in the platform itself. My question is as follows, i'm currently considering taking the MCAD exam but i've seen the press releases about Whidbey, Longhorn, Orcas etc. and i'm wondering will the MCAD based on the current version of .Net be irrelevant too soon to warrant the time & money. spent studying for it? :confused: I know Microsoft have changed their policy of retiring old certifications but does anyone know if they plan to offer an upgrade path or will everyone need to start from scratch. Any info is welcome Cheers Paul Griffin
-
System.Security File I/O problemis it possible to use the common file dialog boxes (SaveFileDialog, OpenFileDialog etc) with the IsolatedStorageFileStream??? Paul Griffin
-
System.Security File I/O problemThanks for the info, i'll take a look into isolated storage then!! Paul Griffin
-
System.Security File I/O problemDoes this mean that at best all i could do is inform the user that the need to run the .net config tool and increase the trust level of the app?? or can i programmtically config my app so that it can access tyhe file system if i give it the correct permissions Paul Griffin
-
System.Security File I/O ProblemHi all, i've developed a c# windows application that envolves file I/O. Up to now all development has been on my own machine running win2k pro and i am logged in as an administrator. I recently tried running the code on another machine on which i installed the .net redistributable and as soon as the app tried to access the file system (i.e when opening a file dialog) it through an exception of the type System.Security.FileIOPermissions. I've looked into it a bit and discovered how the clr assigns permissions to different assemblies at runtime etc. What i'd like to know is, is there a way for me to configure my code so that it can always access the file system on other machines... i don't want the user to have to manually increase the trust level using the .net config tool as that would be very messy!! any help is appreciated Thanks Paul Paul Griffin
-
System.Security File I/O problemHi all, i've developed a c# windows application that envolves file I/O. Up to now all development has been on my own machine running win2k pro and i am logged in as an administrator. I recently tried running the code on another machine on which i installed the .net redistributable and as soon as the app tried to access the file system (i.e when opening a file dialog) it through an exception of the type System.Security.FileIOPermissions. I've looked into it a bit and discovered how the clr assigns permissions to different assemblies at runtime etc. What i'd like to know is, is there a way for me to configure my code so that it can always access the file system on other machines... i don't want the user to have to manually increase the trust level using the .net config tool as that would be very messy!! any help is appreciated Thanks Paul Paul Griffin
-
Combo Box Hell please help!!!Hi all, i've got a really irritating problem that is probably something very simple but is driving me crazy :mad: for some time now. I have a form with a tab control containing several tab pages. On each tab page there is a panel. On the panels i have some graphics and several combo boxes at different locations. the panels are also scrollable. My problem is every time i click on a combo box that is not in view before scrolling down the form seems to invalidate itself and redraw so that the drop down list of the combo box is in the center of the screen. Is there some property which i've missed that can be set to avoid this???? Basically when i click on a combo box i want it to display the drop down list at the location its currently at and not redraw the whole form so its centered. Any advice is VERY welcome, Thanks Paul Paul Griffin
-
ComboBox scrolling ProblemsHi all, i've got an form with a series of comboBoxes placed at intervals vertically. if i scroll down the form to one of the lower comboBoxes and then click on it, it tries to display the drop down list at the original location of the comboBox. Does anyone know if this position can be offset by the scroll position??? any suggestions welcome!! Thanks Paul Paul Griffin
-
Scrolling - Co-ordinates problemThanks Philip believe or not though i've just managed to get around it by trying something a little different.... instead of trying to re create the Rects after the scroll i just modified the mouse click point by subtracting the scroll offset .. that way i don't have to touch the Rects... but thanks for that info .. i'm sure i'll need it further down the road at some stage Cheers Paul Paul Griffin
-
Scrolling - Co-ordinates problemYa your right but i don't actually attempt anything like that luckily what i try to do is add the scroll position offsets to the Rect dimensions by creating entirely new rects but of the same name. the trouble is when to do this ... that's why i was hoping there might be some event triggered by the scrolling Paul Griffin
-
Scrolling - Co-ordinates problemHey all i've got a small app that creates several Rectangle objects as part of its constructor code. These are then used later as bounding rectangles for hit testing of lines. This works very well for my needs ... the problem is when i scroll vertically the rectangles no londer bound the correct area!! i've tried creating a seperate function(which i called in my paint handler) which re-initialises the Rects to the original co-ords plus AutoScrollPosition.X and Y. .... this doesn't seem to have any effect though!!! i guess i'm calling the function from the wrong place but is there an event that's triggered by scrolling as in OnScroll for ex. If anyone has any ideas i'd love to hear them thanks Paul Paul Griffin
-
Displaying Dynamic text on formsHi all does anyone know if its possible to dynamically assign text to a label?? or if any other method could be used to dynamically display text on a form?? everything i've come across seems to use string literals!! regards Paul Paul Griffin
-
Line Drawing (joining the dots!!)Hi all can anyone tell me if a function exists which draws a line segment or series of line segments which adds each point in the line to an array of points?? It would also have to take into account the width of the line drawn!!! Basically i want to be able to draw a line then click on it and compare the mouse click point against all points in the line for a match?? Any ideas would be great!! Regards, Paul Paul Griffin