Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

jjansen

@jjansen
About
Posts
58
Topics
11
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Drawing on second monitor using Graphics
    J jjansen

    Christian Graus wrote:

    I'm not sure how you'd go about getting the DC to draw directing to the desktop, however, am I right in thinking that's what you want ?

    Actually, I don't want to draw on the desktop but on top of my own application across several separate controls, basically to display a box around an area to draw attention to it. I tried walking through the nested controls on my form, but you can only draw in their client areas, which in some cases doe not cover the entire control (e.g. Edit boxes and list boxes with borderstyle "Fixed3D"). Hence I felt forced to revert to old GDI.

    C# graphics csharp help question

  • adding an item to context menu
    J jjansen

    You need to use Shell-extensions for that. Try a search on the interfaces IContextMenu, IContextMenu2 and IContextMenu3.

    C# help tutorial question

  • Drawing on second monitor using Graphics
    J jjansen

    Using the Screen class I can retrieve the DeviceName of my second monitor, which I can feed into CreateDC to get a device context (DC) of that particular monitor. With it I am able to use all kinds of GDI drawing functions, which do show on my second monitor. Although that works, I would rather draw with a C# Graphics object. The problem is that when I make a Graphics object (with Graphics.FromHdc), I get one with the property VisibleClipBounds set to the bounds of the PRIMARY monitor, and this property is read-only! Does anyone know how I could get the VisibleClipBounds to correspond to the bounds of the right monitor (or all monitors)? Thanks.

    C# graphics csharp help question

  • How to get program start directory after using FileDialog
    J jjansen

    Ramith Sivanarain wrote:

    Is there a Function that returns the path at start of the process (program)

    Try Application.StartupPath

    C# csharp winforms tutorial

  • member hiding question
    J jjansen

    I think the solution to your problem is this: Hide the property of the base class, but make the access modifier the same as in the base class, i.e. public. Next, add the modifier protected to the set-accessor (.NET 2.0 required). The get-accessor cannot be protected as well, but I don't think that's a problem, I fact I think it's good practice to keep the get-accessor accessable. You'll get something like this: public new int Value { get { return (base.Maximum - (base.Value - this.Minimum)); } protected set { base.Value = base.Maximum - (value - this.Minimum); } } That should work.

    C# question help

  • member hiding question
    J jjansen

    Heritos Gger wrote:

    However, the compiler says "Use of keyword 'base' is not valid in this context".

    The error is not related to the use of the keyword 'base', but to the fact that you try to cast the base to type TrackBar. You don't need to do that. Remove all of these casts (e.g. ((TrackBar)base).Value should be base.Value) and the compiler error will disappear.

    C# question help

  • Retrieve text on MessageBoxButton-button [modified]
    J jjansen

    Nader Elshehabi wrote:

    You can store your texts in a string table, or even an array for whatever it's worth!!

    The point is that I do not know WHICH languages I will encounter. Therefore, I can never make a 'complete' list of button texts (if I had that many dictionaries anyway). In order to make it work for ANY language I will need to ask Windows for the button texts. Anyway, Guffa has pointed me into another direction. Thanks though.

    C# question

  • Retrieve text on MessageBoxButton-button [modified]
    J jjansen

    You're right, that would work too. If the question gets too complicated (or potentially confusing) to answer with a simple Yes or No you should go for the custum dialog anyway. Thanks.

    C# question

  • Retrieve text on MessageBoxButton-button [modified]
    J jjansen

    Guffa wrote:

    but why do you want to present a translation table to the user?

    Perhaps my example wasn't really appropriate. Try this message: "The item aleady exists in the list. Do you want to overwrite it? If you press 'No' the item will be lost." Now, if the user has, say, a French version of Windows I would like to replace the string 'No' with 'Non', because that is the text the French OS will display on the MessageBoxButton.No . Or if he has a German version I want to replace it with 'Nein'.

    Guffa wrote:

    You should use a custom dialog so that you can put a meaningful text on the buttons

    Perhaps that is the better solution. Still, if anyone knows a method to query Windows for its standard texts, I am very interested. Thanks for your responses, all of you.

    C# question

  • Retrieve text on MessageBoxButton-button [modified]
    J jjansen

    Nader Elshehabi wrote:

    You can inherit your own custom MessageBox from that class, or make your own form to simulate the MessageBox you want to display

    Yes, but then I have to make one for every language version of Windows the user might be using.

    C# question

  • Retrieve text on MessageBoxButton-button [modified]
    J jjansen

    Mark Nischalke wrote:

    You should use DialogResult if( MessaseBox.Show() == DialogResult.Yes )

    I know and I am, but in this case I'm interested in what text is visible to the user so I can incorperate the same text in my message text.

    C# question

  • Retrieve text on MessageBoxButton-button [modified]
    J jjansen

    I'm using a MessageBox to give the user a choice. The text is something like "Press 'Yes' if you want to continue or press 'No' if you want to quit". However, I know my users will have Windows OS installed in various languages, other than English. I want to keep the message text in English, but I do want to let the 'Yes' and 'No' parts correspond to the actual texts on the messagebox button. Is there a way to find out the text that is displayed on the Yes-button given the language of Windows? Is there a function that can give me this button text. Thanks. -- modified at 9:25 Thursday 28th September, 2006

    C# question

  • working with 2D Array
    J jjansen

    You forgot to allocate the size of the second dimension of variable wind. You need to do something like this: int[][] wind = new int[2][]; wind[0] = new int[3]; wind[1] = new int[5]; Set the size of the first dimension to 2 (you've done that). Then you need to set the sizes of the second dimension for each of the elements (!) in the first dimension. By the way, if you want the sizes of the second dimension to be the same, you might consider using a two-dimensional array like this: int[,] wind = new int[2, 3];

    C# data-structures help tutorial

  • How to suppress a scroll bar
    J jjansen

    I still haven't been able to suppress the scroll bar. The panel totally ignores the property HScroll and other scroll bar methods :mad:. However, I can now hide the scroll bar using the Interop function ShowScrollBar, although it doesn't prevent the scroll bar to appear briefly.

    C# help wpf tutorial question

  • Split string
    J jjansen

    RahulRKulkarni wrote:

    But i think it is not in the framework-1.1

    You're right, it's new in Framework 2.0. Perhaps you can use IndexOf("***") in combination with Substring.

    C# tutorial

  • Split string
    J jjansen

    Try this: string[] Parts = tosplit.Split("***", StringSplitOptions.RemoveEmptyEntries);

    C# tutorial

  • continuous scrolling [custom controls]
    J jjansen

    You could try using a Timer. Start it when the mouse button is pressed and with every tick of the timer (perhaps after a delay) you change the scroll value a little. Stop the timer when the mouse button is released.

    C# tutorial question

  • How to suppress a scroll bar
    J jjansen

    I noticed that when the XP visual styles are on, the Panel control sometimes adds a horizontal scroll bar when it is not necessary. The controls in the Panel fit the visible area fine (including the scroll margin and vertical scroll bar). This does not happen when the visual styles are off, i.e. in the Windows classic style X| ! It doesn't matter if the AutoScroll property is set to true or false. To fix this problem I wanted to hide the horizontal scroll bar manually. I tried to use the HScroll property. The MSDN documentation on the ScrollableControl (from which Panel is derived) class says: "To manually override which scroll bars are visible, set the VScroll and HScroll properties. If either property is set to false, the corresponding scroll bar is not visible, even if the AutoScroll property is set to true." This simply isn't true :mad:. You can set the property HScroll to false, but the horizontal scroll bar is still there and remains functional. The method SetScrollState doesn't work either. Does anyone know how I can suppress a horizontal scroll bar in a panel? Thanks.

    C# help wpf tutorial question

  • handling control array in runtime
    J jjansen

    vatzcar wrote:

    i don't know how to reasign the length of an array so it's being a problem for me.

    To solve this problem, you could use a generic list. using System.Collections.Generic; List pcbMem = new List(); Private void CreatePictureBoxes() { ... for (int i = 0; i < intCount; i++) { PictureBox myPcb = new PictureBox(); ... pcbMem.Add(myPcb); } }

    C# database help data-structures tutorial

  • Using drag and drop in c#
    J jjansen

    It seems the application Form is the only "control" that is able to receive drag-drop events when an OpenFileDialog is open (with the OpenFileDialog belonging to that application). If you do not "own" this Form, for instance if you are developing a user control for distribution, then I'm afraid you can't do what you intent to do. Sorry :^).

    C# question csharp help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups