|
I am amazed to find that nothing exists (that I can find from a internet search and here at CP) to suspend a windows form from updating itself.
I've tried suspendlayout and resumelayout methods of the form with no luck.
I see calling the win32 api is one way but wow, this could easily be done in VBA with "ScreenUpdating=false" then set to true again when you wanted to hide screen happenings from the user.
My needs arise from programmatically setting some control's (comboboxes, textbox) values that I don't wish the user to see necessarily.
Any ideas?
|
|
|
|
|
Why would you set values to controls if you don't want the user to see them ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
The user will use the controls to input information of course. But, I want the user to be able to do a "quick entry" of sorts, by a less onerous method via some other controls (radio buttons) that, based on these simple choices, cause code to programmatically set the values of these other more numerous controls (with their events firing etc that I want).
What my goal is by this design is to 1)make common entries faster for the user to enter and 2)ensure the logic (there's quite a bit of interactions of the controls) of these controls to be the only path of creating the data that the user will be storing via the app. ..so it's a single pathway of logic/code/bug opportunity & fix, in determining the many data elements that the user needs to indicate to the app for what they need to store.
Anyway, since my original post I found that I could just set the container of the controls, in this case a tabpage of a tab control, to not visible for the time in question, then set it back to visible afterwards. That seems to work well enough. . .I was just surprised to not have another way of doing what had been available in VBA.
I guess if one had a bunch of controls on a form and wanted the user to see them but also have done what I am aiming at then it would be a little more difficult without the way that is easy in VBA (screenupdating=false).
|
|
|
|
|
OK. Well, what you're doing seems the most sensible way of achieving that to me. I'd just think if you have a quick entry method, there's no reason for the client not to see the result. But, you understand your business rules better than I do, I guess.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
If i have employee class properties such as ID and Name then i can get their data respectively through the attributes. Is it possible to get the entire employee object rather than getting the individual property data. I mean how can i delcare an attribute that can hold the class reference where it is delcared
public class Employee
{
[TypeConverter(typeof(EmployeeID))]
public string ID
{
get{return id;}
set{id=value;}
}
[TypeConverter(typeof(NAME))]
public string Name
{
get{return name;}
set{name=value;}
}
}
|
|
|
|
|
updatecom.CommandText="update test2 set name='" + textBox1.Text + "' job= '" + textBox2.Text +"' title='" + textBox3.Text + "'where id=" + textBox4.Text + "";
Ahmed hassan
|
|
|
|
|
try some comma's between the ' and job and ' and title
|
|
|
|
|
|
And as an addition to the previous post, use parameters for values. You are now for example vulnerable to sql injections.
|
|
|
|
|
1: instead of saying 'not working', tell us what the error is. Putting commas in to fix your SQL will obviously work.
2: read up on SQL Injection attacks, to find out how I can erase your entire database if you release this code
3: tell me you're not really using variables called textBox1, textBox2, etc. Or are you trying to write unreadable code on purpose ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
You may try this:
updatecom.CommandText = "update test2 set name='" + textBox1.Text + "', job= '" + textBox2.Text +"', title='" + textBox3.Text + "' where id='" + textBox4.Text + "'";
Fixed "," and "'"
Saludos!!
____Juan
|
|
|
|
|
Hi,
This might seem pretty basic but can anybody explain why and/or when a method should have the static or virtual? i.e.
public static void Method1()
{}
Thanks,
Prateek
|
|
|
|
|
|
I guess i should have checked msdn first before posting the question.
Thanks
|
|
|
|
|
|
I have a standard Calendar Control:
<asp:calendar id="calNewFirstDateAvailable" runat="server" tooltip="Select First Available Date" xmlns:asp="#unknown">
</asp:calendar>
And I am attempting to set a specific Date as the highlighted date programatically, but it is not highlighting the day in the control.
calUpdateFirstDateAvailable.SelectedDayStyle.BackColor = System.Drawing.Color.Black;
calUpdateFirstDateAvailable.SelectedDayStyle.ForeColor = System.Drawing.Color.White;
calUpdateFirstDateAvailable.SelectionMode = CalendarSelectionMode.Day;
calUpdateFirstDateAvailable.SelectedDate = atsi.StartDate;
calUpdateFirstDateAvailable.VisibleDate = atsi.StartDate;
atis.StartDate is a DateTime type with the value of '{11/12/2008 11:09:03 AM}'
What am I doing wrong?
Any Help would be greatly appreciated.
VS2008 .net 3.5
Thanks,
Robert
|
|
|
|
|
This may be completely wrong, but I recall the order you set the properties may have an affect on what and when is displayed.
BTW: ASP.NET questions belong in the ASP.NET forum.
xacc.ide - now with TabsToSpaces support IronScheme - 1.0 beta 1 - out now! ((lambda (x) `((lambda (x) ,x) ',x)) '`((lambda (x) ,x) ',x))
|
|
|
|
|
Hello,
I can't seem to find any info regarding this because I don't know what to look for. I really have tried looking on the net, looking on here, searching both articles and message boards, and nothing is quite what I'm needing.
What I'm trying to do is find a component that shows the contents of my drive, similar to looking at the Desktop in the Explorer.
I would also like to have checkboxes next to the folder names so that a user can select multiple folders. Checkboxes are preferred, but if Ctrl+Select is the only option, then ok.
Something like this is out there... I know I've seen it somewhere, but just can't find out what it's called, or any code that uses it as an example.
Any suggestions?
Thanks,
Michael Fritzius
|
|
|
|
|
There's nothing that's standard, it would have to be a user control of some sort.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
That's fine--I'm not set on using anything standard anyway. But I wouldn't even know how to make my own control for this application. Has anyone made something like this?
|
|
|
|
|
|
Excellent. Looks like this would work. Thanks!
|
|
|
|
|
You're welcome
|
|
|
|
|
Hi, i want to convert arrys of one type to arrays of another type
Here is the code that i have
public object ConvertTo(Type myType, object value) {
object[] ret = Array.ConvertAll(value as object[], delegate(object o) { return Convert.ChangeType(o, t.GetElementType()); });
return ret;
}
Everithing its just fine, but the problem using Array.ConvertAll is that I have an object[] reference, an not an t.GetElementType()[] reference
So, when i use the variable returned by that function, i have an InvalidCastException because object[] cannot be converted to myType[]
How can i make a cast to the type i really want?
The next code works perfectly, but i want it to work with a generic type
public object ConvertToStringArray(object value) {
string[] ret = (string[])Array.ConvertAll(value as object[], delegate(object o) { return o.ToString(); });
return ret;
}
Maybe the question is how to create an array of a type represented by an instance of System.Type
Example:
Type t = typeof(System.String);
Saludos!!
____Juan
|
|
|
|
|
Maybe you need to write a generic method that takes a type and creates an array of that type ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|