Click here to Skip to main content
16,006,440 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: computer to computer communication event Pin
Christian Graus9-Sep-09 13:52
protectorChristian Graus9-Sep-09 13:52 
QuestionClass not registered Pin
RossouwDB9-Sep-09 9:01
RossouwDB9-Sep-09 9:01 
AnswerRe: Class not registered Pin
Christian Graus9-Sep-09 9:22
protectorChristian Graus9-Sep-09 9:22 
GeneralRe: Class not registered Pin
RossouwDB9-Sep-09 10:44
RossouwDB9-Sep-09 10:44 
GeneralRe: Class not registered Pin
Christian Graus9-Sep-09 11:20
protectorChristian Graus9-Sep-09 11:20 
GeneralRe: Class not registered Pin
RossouwDB10-Sep-09 5:01
RossouwDB10-Sep-09 5:01 
GeneralRe: Class not registered Pin
RossouwDB12-Sep-09 5:08
RossouwDB12-Sep-09 5:08 
QuestionSuspendLayout, changing Width property and ResumeLayout(True) Pin
EliottA9-Sep-09 7:46
EliottA9-Sep-09 7:46 
Still an issue with UserControls here, with inconsistent behavior of SuspendLayout and ResumeLayout.

My UserControl consists of 3 panels and 2 buttons.

Docking and anchoring is used to mimic consistent 'look and feel' despite the size of the control (primarily Width).

A Menu Control is populated with numerous instances of the UserControl defined above. Using a loop, I am resizing all these controls to an appropriate Width which is dynamically generated.

To increase performance as well as usability, my intention was to call SuspendLayout, resize the control by increasing or decreasing the Width, then calling ResumeLayout(True) so that a user does not see redrawing on the screen.

Obviously, without SuspendLayout() and ResumeLayout(True) the user will see the controls redrawing, which is time consuming and very poor to see.

However, when SuspendLayout() is called and then the control's Width property is changed, after ResumeLayout(True), the control is never resized. The Width property shows that the control's Width should be what I set, but the control is visibly unchanged.

What's worse is this behavior is not duplicated on another UserControl which has a similar hierarchy of panels and buttons, using the exact same loop those controls resize visibly as intended.

On a side note, I have enabled Double Buffering on all controls for faster drawing, albeit with little to no visible effect on the resizing of these controls.

My secondary solution involved shadowing SuspendLayout() and ResumeLayout() to loop through all controls and force SuspendLayout on the controls children, but that proved problematic and the lack of hits on Google and MSDN on either shadowing or overloading / overriding the SuspendLayout and ResumeLayout methods proved ineffective.

If any of this is unclear, it is because I have not had to much coffee today, so I'll answer any unclear statements about my problem at hand.

Example coding:

Dim o As System.Windows.Forms.Control
Me.ControlMenuComboBox.Width = i
For Each o In _collection
    o.SuspendLayout()
    o.Width = i
    o.ResumeLayout(True)
    o.Update()
Next ' the controls in the above loop DO NOT resize visibly as intended, Width property shows value of variable i.
For Each o In Me.Controls
    o.SuspendLayout()
    o.Width = i
    o.ResumeLayout()
Next ' the controls in the above loop resize visibly as intended, Width property shows value of variable i.


As I assume the following is important I cannot stress it enough; all controls show the Width property has been set to variable i, however I feel that SuspendLayout() is inconsistent between my UserControls.


QuestionPossible to pass a string to a Function as name of an array? Pin
Hurricane30009-Sep-09 5:42
Hurricane30009-Sep-09 5:42 
AnswerRe: Possible to pass a string to a Function as name of an array? Pin
Dave Kreskowiak9-Sep-09 6:17
mveDave Kreskowiak9-Sep-09 6:17 
GeneralRe: Possible to pass a string to a Function as name of an array? Pin
Hurricane30009-Sep-09 7:19
Hurricane30009-Sep-09 7:19 
GeneralRe: Possible to pass a string to a Function as name of an array? Pin
Christian Graus9-Sep-09 9:26
protectorChristian Graus9-Sep-09 9:26 
GeneralRe: Possible to pass a string to a Function as name of an array? Pin
Dave Kreskowiak9-Sep-09 11:16
mveDave Kreskowiak9-Sep-09 11:16 
AnswerRe: Possible to pass a string to a Function as name of an array? Pin
dan!sh 9-Sep-09 6:26
professional dan!sh 9-Sep-09 6:26 
GeneralRe: Possible to pass a string to a Function as name of an array? [modified] Pin
Hurricane30009-Sep-09 7:30
Hurricane30009-Sep-09 7:30 
GeneralRe: Possible to pass a string to a Function as name of an array? Pin
EliottA9-Sep-09 8:52
EliottA9-Sep-09 8:52 
AnswerRe: Possible to pass a string to a Function as name of an array? Pin
Christian Graus9-Sep-09 9:28
protectorChristian Graus9-Sep-09 9:28 
GeneralRe: Possible to pass a string to a Function as name of an array? Pin
Hurricane30009-Sep-09 11:03
Hurricane30009-Sep-09 11:03 
GeneralRe: Possible to pass a string to a Function as name of an array? Pin
Christian Graus9-Sep-09 11:20
protectorChristian Graus9-Sep-09 11:20 
GeneralRe: Possible to pass a string to a Function as name of an array? Pin
Hurricane300010-Sep-09 4:27
Hurricane300010-Sep-09 4:27 
AnswerRe: [Solved] Possible to pass a string to a Function as name of an array? Pin
Hurricane300010-Sep-09 6:28
Hurricane300010-Sep-09 6:28 
Questionsending Email Attachments Pin
Bob Beaubien9-Sep-09 4:30
Bob Beaubien9-Sep-09 4:30 
AnswerRe: sending Email Attachments [modified] Pin
Nuri Ismail9-Sep-09 5:32
Nuri Ismail9-Sep-09 5:32 
GeneralRe: sending Email Attachments Pin
Bob Beaubien9-Sep-09 9:20
Bob Beaubien9-Sep-09 9:20 
GeneralRe: sending Email Attachments Pin
Nuri Ismail9-Sep-09 10:32
Nuri Ismail9-Sep-09 10:32 

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.