472,984 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,984 software developers and data experts.

Develop own UserControl

Hello there,

i want to write my on control. Its a control which
contains a collection of other controls like TextBox and more.

So i want to have a border like the Panel Control
only for Designer. The panel have a light black border
during programming in VS .NET!

In Runtime the border ist not visible.

Can anyone help me and tell me what should i do to
have the same effect?

Cheers
René

Nov 19 '05 #1
1 1517
Hello René,

every component has a DesignMode property that you can use to determine if you're at design-time or run-time. You could use this property and paint a
border for the user control. Here is an example:

Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
MyBase.OnPaint(e)

Dim controlRect As Rectangle = ClientRectangle
controlRect.Inflate(-1, -1)

If (Me.DesignMode = True) Then
e.Graphics.DrawRectangle(New Pen(Color.Black), controlRect)
End If
End Sub
HTH

Antoine
Microsoft Visual Basic .NET

--------------------
From: =?iso-8859-1?Q?Ren=E9_Paschold?= <re***@ppedv.de>
Newsgroups: microsoft.public.dotnet.languages.vb
Subject: Develop own UserControl
Date: Fri, 22 Aug 2003 17:04:15 +0200
Lines: 17
Message-ID: <bi************@ID-96132.news.uni-berlin.de>
NNTP-Posting-Host: p508a947f.dip.t-dialin.net (80.138.148.127)
Mime-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de 1061564479 5737948 80.138.148.127 (16 [96132])
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!news-out.cwix.com!newsfeed.cwix.com!news.tele.dk!news.t ele.dk!small.news.tele.dk!fu-berlin.de!uni- berlin.de!p508a947f.dip.t-dialin.NET!not-for-mailXref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.vb:129711
X-Tomcat-NG: microsoft.public.dotnet.languages.vb

Hello there,

i want to write my on control. Its a control which
contains a collection of other controls like TextBox and more.

So i want to have a border like the Panel Control
only for Designer. The panel have a light black border
during programming in VS .NET!

In Runtime the border ist not visible.

Can anyone help me and tell me what should i do to
have the same effect?

Cheers
René

--

This posting is provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

Note: For the benefit of the community-at-large, all responses to this message are best directed to the newsgroup/thread from which they originated.

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: David N | last post by:
Hi All, I just wonder if in C#, I can develop a user defined control that can call its parent function which is not yet developed. For example, how do I make my user control call a...
8
by: Raed Sawalha | last post by:
Hi, I have a strange problem with a usercontrol on a page. The usercontrol dispalyes three categories (From a database) when the user clicks a category they see all the products in a shop for...
2
by: Sascha | last post by:
Hi there, I searched carefully through the web before finally deciding to post this message, because I could not find a solution for my problem. Hopefully someone will have a hint or explanation...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
12
by: Joe | last post by:
Hello All: Do I have to use the LoadControl method of the Page to load a UserControl? I have a class which contains three methods (one public and two private). The class acts as a control...
9
by: Marcelo Cabrera | last post by:
Hi, I have a user control that in turn creates a bunch of webcontrols dynamically and handles the events these webcontrols raise. It used to work fine on ASP .Net 1.1 but when compiled on 2.0 it...
6
by: MeowCow | last post by:
I have created a UserControl that encapsulates a third party data grid. My goal was to create my own DataSource and DataMember properties that forward the binding to the third party grid, then use...
3
by: avy32 | last post by:
Hi I develop an usercontrol that inherits the button class in Visual Basic Net.That usercontrol I will use it in a Visual basic 6 application. When I put this usercontrol on a form in Visual Basic...
10
by: Benton | last post by:
Hi there, I have a UserControl with a couple of textboxes and a couple of buttons ("Save" and "Cancel"). The Click event for this buttons is in the UserControl's codebehind of course, so here's...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.