473,406 Members | 2,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

UserControl not behaving itself

hi, I'm trying to create a user control Button that
displays a confirm message when the user clicks on it.
(But only when they've set a 'confirm' property.)

The issue is that I want the user control to stop it's
childs click event.

i.e. if I put the control onto a form, set the click code
to me.close(), then set 'confrim = True'.

I'd expect the click of the user control to fire first,
display the msgbox with the confirm message, the user
presses 'Cancel', the code line 'Exit sub' should stop the
me.close() from firing.

I'm sorry if this sound confusing...here's my code:

Private Sub HotButton_Click(ByVal sender As Object, ByVal
e As System.EventArgs) Handles MyBase.Click
If _Confirm = True Then
Dim lcMsg As String = "Are you sure?"
If _Confirm_Message <> "" Then
lcMsg = _Confirm_Message
End If
If MsgBox(lcMsg, MsgBoxStyle.OKCancel +
MsgBoxStyle.Question, "Are you sure?") <> MsgBoxResult.OK
Then
Exit Sub
End If
End If

End Sub

''''''''''''''''''''''''''
Any help would be greatly appreciated.
cheers
moose
Jul 21 '05 #1
0 872

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

Similar topics

6
by: Peter Wone | last post by:
Hosting the WebBrowser control is easy. Customising it is not. You have to implement IDocHostShowUI, IDocHostUIHandler, IDocHostUIHandler2, and IOleClientSite, not one of which appears in a typelib...
1
by: jralford | last post by:
Hi, Another question from a C# newbie: I have a usercontrol class that includes a customized control. Now, if I create an instance of the class, and click on it, a click event is raised for the...
4
by: Harry | last post by:
Hello, I have a page with a RadioButtonList and a PlaceHolder control. The RadioButtonList's AutoPostBack attribute is set to TRUE and its SelectedIndexChanged event loads one of three...
0
by: Matthew | last post by:
All, I have searched google and the newsgroups but can't find anything the same as what I am experiencing (though I may have missed something). I have controls (textboxes) within UserControls...
0
by: oliver | last post by:
QUESTION: How to access an object embedded in a UserControl through Javascript file? Another way to ask this question: How to execute script from a UserControl, accessing other objects in that...
2
by: gerry | last post by:
based on MSPress's ASP.NET 2.0 Applications Advaced Topics ( Table 12-3 p.472 ), and most events should be automatically wired up when @Control AutoEventWireup="true". ie. Page_InitComplete() {}...
5
by: Blue | last post by:
We have a custom word processing type editor built with C# and .NET 2.0 and we need to support typing in languages other than English. I want to be able to use the Windows IME to enter in text...
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...
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...
1
by: Tony Johansson | last post by:
Hello! I'm reading in a book and here they says. "Now it is time to begin thinking about which events the control should provide. Because the control is derived from userControl class, it has...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.