Search results for query: *

  1. P

    What is the counterpart of this C pointer programme in VB.Net?

    I'd like to know how the following programme on pointer written in C can be written in VB.Net, especially how to use the keywords in the C programme like &i and *p in VB.Net. Please clarify. #include <stdio.h> void f(int *p, int *q) { p = q; *p = 2; } int i = 0, j = 1; int main() {...
  2. P

    Question Detecting mouse button down & up events on the system menu of form.

    How do I detect left mouse button down and up events on the 'Close' option of the system menu that appears when the mouse is clicked on the top left corner of a form?
  3. P

    Question Is disposing a local brush variable necessary?

    MSDN recommends disposing any variable of type System.Drawing.Brush before its last reference is released. Otherwise, the resources it is using will not be freed until the garbage collector calls the Brush object's Finalize method. As we know, local variables are destroyed automatically when...
  4. P

    Question Displaying MdiChild ToolStrip into MdiParent during runtime.

    I have an MDI application containing an MdiParent form and few MdiChild forms. The MdiParent has a fixed MenuStrip, a fixed ToolStrip and a fixed StatusStrip. The MdiChild forms have one or more ToolStrips and a StatusStrip along with other controls in them. The ToolStrips and the StatusStrip of...
  5. P

    Question Elements of a toolstrip witin an usercontrol get deleted when copying/pasting it.

    I have an usercontrol that contains a toolstrip. The toolstrip is exposed through the usercontrol by a readonly property 'HostStrip' with DesignerSerializationVisibility.Content attribute. In this way we can handle the toolstrip and its contents from the usercontrol. While using the usercontrol...
  6. P

    Question How to obtain the first line of a multiline text field saved into database?

    I have a multi-line textbox whose text is saved into database. Now I need to obtain only the first line of the text to be shown in a datagridview. How can I do it?
  7. P

    WmiSetBrightness method not supported (.Net 4.0, Winforms, Windows 7).

    I'm trying to adjust the brightness (not the gamma ramp values) of the monitor using WmiSetBrightness method but the system throws a ManagementException during runtime saying 'Not supported'. I have seen a lot of people using this concept and running successfully. So what's wrong with mine? Is...
  8. P

    Question How to use an Items Collection Editor on a custom UserControl (.Net 4, Winforms)?

    I created a UserControl that contains a custom ToolStrip Control. While using the UserControl throughout an application, the ToolStrip control cannot be accessed directly, as logically it's embedded in the UserControl. So, to access the items of the ToolStrip I defined a readonly property in the...
  9. P

    Question Problem in ToolStripComboBoxItem arrow paint (VS.Net 2010, WinForms).

    I am rendering a toolstrip with a CustomRenderer that inherits from ToolStripProfessionalRenderer. The concept is that I want the color of the arrow of the toolstrip items to be white in all cases except selection. When it is selected the color should be black. In my code below all arrows are...
  10. P

    Question Problem in ToolStripProgressBar painting (VS.Net 2010, WinForms).

    Ensure ApplyVisualStyles is enabled in your system. Place a ToolStripProgressBar on a toolstrip, run your application and minimize the form. Now change the theme of your computer to Windows Classic and restore the form. See the interior of the ToolStripProgrssBar becomes black. It doesn't even...
  11. P

    Question Problem in inherited form (VS.Net 2010, WinForms).

    I built a ClassLibrary where I have created my custom form component (let's say MyForm) that inherits from the Form class. I added the ClassLibrary to my actual WinForms project. Now when I add an inherited form to my project from MyForm, its Text property remains blank by default. I even tried...
  12. P

    Question Problem in creating numeric textbox (.Net 4.0).

    Hi, I'm trying to create my own numeric textbox that will handle decimal as well as whole number values. The concept is, unlike the regular textbox, this one will accept a value of 'Double' data type and show it with proper formatting e.g. Leading Digits, Digit Grouping etc. When the textbox...
  13. P

    Question Detecting X button click of a window in winforms.

    How can I detect the click event of the close (X) button at the top right corner of the control box of a form/window? Please note, I don't want to know about CloseReason, FormClosing, FormClosed or stuffs like these, unless they are inevitable. I exactly want to detect if the user clicked the X...
  14. P

    Question Changing default value of a property of a control (DataGridView).

    I am inheriting my own datagridview (say MyDataGridView) from the standard datagridview control. What I want is that certain properties of MyDataGridView should have a different default value than what its base have. For example, AllowUserToAddRows, AllowUserToDeleteRows, AllowUserToResizeRows...
  15. P

    Question Problem in painting custom panel control (.Net Framework 4.0).

    I have inherited the standard panel control to create a panel having custom border color. The problem is, while the panel is on a form and any other form is moved across it, it paints hapazard lines of the same color as the panel custom border color, all throughout background of the panel. I...
  16. P

    Question How to set borderstyle of a datagridview column at runtime (.Net Framework 4.0)?

    I have a readonly datagridview that is bound to a datasource. It has two columns. Now I want the first column to have no cell borderstyle; and the second one to have 'All' (i.e. all sides of the cell shall have a border) as cell borderstyle. Before binding the datagridview to the datasource...
  17. P

    Question DataGridView checkbox column header cell (.Net 4.0).

    Hi, I'm trying to render a checkbox in a datagridview column header so that when the checkbox is checked/unchecked all the cells in that column should be checked/unchecked accordingly. The datagridview is bound to a database table but the column containing the checkbox header cell is unbound...
  18. P

    Question DataGridViewLinkColumn SelectionBackColor and SelectionForeColor not taking effect.

    Setting the SelectionBackColor and SelectionForeColor of a DataGridViewLinkColumn from the design IDE doesn't take effect. The cell texts still hold the default color blue. Why is this happening? Thanks.
  19. P

    Question DisplayFormat/DisplayStyle property of TextBox

    Is there any predefined property by which I can set the DisplayFormat/DisplayStyle of a textbox? Suppose I want a textbox to hold the actual value 888888888888.88 and show it formatted as 888,888,888,888.88. In short it should hold 'Double' data type value and show it with thousand separators...
  20. P

    Question Determining opening location of a form.

    I have a button on my form. When I click it, I want a form to be opened exactly on the location where the button is. How to achieve this? Thanks.
Back
Top