Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I would like to freeze a checkbox on a form (but not disable it). Is it possible in VBA?
You could stop the user from changing the value by putting some code into the click event of the checkbox..
Private Sub MyCheckBox_Click()
Me.MyCheckBox.Value = True
End Sub
You could also use the Locked property.
Private Sub UserForm_Activate()
Me.MyCheckBox.Value = True
Me.MyCheckBox.Locked = True
End Sub
And you could also use the BeforeUpdate event..
http://msdn.microsoft.com/en-us/library/office/ff822421(v=office.15).aspx
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I am trying to make a simple timer kind of GUI application using the python tkinter module.
The requirements of my application are
Should have no buttons.
It must have a dynamic field that shows the time taken in seconds.
I have searched a lot but wasn't able to conclude.
So, expecting whether can my requirement be met using Tkinter?
If yes, wishing to know the way of achieving it.
If no, can my requirement be met using any other python or other GUI libraries?
Thanks in advance.
Yes this can be achieved with tkinter, take a look at this example below:
from tkinter import * #importing
import time
root = Tk() #creating a window
def change():
l.config(text=time.ctime()) #update the text on the label
root.after(500,change) #repeat the function each 500 ms
l = Label(root, text='Hello world',font=(0,20)) #creating a label on window
l.pack() #putting it on the window
change() #calling the function initially
root.mainloop() #putting it inside a loop
Note that your calling this function each second, which might not be efficient, this is will work for small projects and its here to just give you an idea.
Hopefully you get a idea of whats going on here, I recommend you watch a detailed video on tkinter and proceed to work with it.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
How to make a message box on the Cancel button?
https://4sysops.com/wp-content/uploads/2015/09/Yes-No-prompt.png
Implement the CancelButtonClick event function.
[Code]
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
MsgBox('Cancel button was clicked', mbInformation, MB_OK);
end;
Set the Cancel and Confirm out parameters to make Inno Setup proceed as you need.
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 6 years ago.
Improve this question
In c# 4.0 I would like to set, at an application level, a default caption for any message boxes the program creates. And by caption I mean the title of the message box.
So should a error message be displayed to the user they will all have the same title.
I know I can do it by using this Message Box overload:
MessageBox.Show(errorMessage, caption);
But I am wondering if there is a more crisp, clean, way to do it?
Rather than having to add a parameter to lots of calls?
You can't really set a default. But you can make a helper to set the title for you, if you really want
public static class MessageBoxEx
{
public static void Show(string message)
{
MessageBox.Show(message, "My Application Name");
}
}
You can of course set the caption however you want, such as from a resource file for multiple languages and locales.
Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 6 years ago.
Improve this question
I'm a beginner in Android Studio and am trying to figure out how to edit different layouts(.xml files) with one java class(.java). I am trying to get the id of an ImageView on another layout, but the findViewById of the ImageView returned null. What do I need to do? Also, I have two layout files because I am using a popupWindow. So, I need to access the ImageView of the popupWindow.
Thanks!
It sounds like you are just using Activity's findViewById, which would search the activity's layout for your ImageView. You would need to call findViewById on your inflated popup view:
View popupView = getLayoutInflater().inflate(R.layout.popup, null);
//Get your image view from the inflated popup
ImageView image = (ImageView) popupView.findViewById(R.id.imageView);
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 2 years ago.
Improve this question
I'm using MVC. I need to get the current AD username (probably using SAMAccountName) and pass the value on a mailto javascript (should pass value on an email body).
Where should I put the SAMAccountName code and how will I use the value?
Technically you should be putting this into the ViewData. If you have to do this all over the place, I'd recommend subclassing Controller and overriding OnActionExecuted to get the current user's userid and putting it into the viewstate:
public class BaseController : Controller
{
protected override void OnActionExecuted( ActionExecutedContext filterContext )
{
ViewData["userid"] = Request.User.Identity;
}
}
Then have your controller extent BaseController
public class MyController : BaseController
{
public ActionResult View( int id )
{
return View();
}
}
Then in your view you can access the ViewData["userid"]
Email User
All this being said, if you're going to be doing access control and the like, you might build a "LoggedInUser" class that you can add helper methods to. Then stick it in the session (assuming you're ok using session). You can do this logic in the Global.asax Session_Start method.