|
You have to put your drawing code in the Paint event of your form. Anywhere else and you're pretty much wasting your time.
The form gets invalidated, meaning that it needs to repaint itself. There are several things that can cause a repaint, such as dragging another window acrossed your form, or calling the form's Invalidate method. This forces Windows to schedule a repaint of your form.
You might want to setup a Timer on your form, setting it for say 100 milliseconds (one tenth of a second). Handle it's Tick event, and in your handler, update the new position of your object, then call the form's Invalidate method.
|
|
|
|
|
thanks a lot Dave.
i did put in in the form_Paint, i'm trying to trigger the repaint event by a keydown event. i call invalidate inside the keydown event, but the graphic still flickered.
|
|
|
|
|
How did you set the double buffer and where did this code get put?? Also, what does the painting code look like?? What does the keydown code look like??
|
|
|
|
|
i think i get it finally...
thanks a lot
|
|
|
|
|
I would like to get some input on threading? In VB that is, Its just a hard concept to understand.
-- modified at 9:57 Tuesday 30th October, 2007
tim637
|
|
|
|
|
|
Thanks I'll have a go at it right away.
tim637
|
|
|
|
|
Go ahed...Good luck !!!
|
|
|
|
|
|
I'm using the following code to get a list of databases on a Microsoft SQL server. In this case you supply it a user name and password, but is there a way to tell it to use windows authentication instead?
Dim sqlserverlist As SQLInfoEnumerator = New SQLInfoEnumerator
sqlserverlist.SQLServer = Me.ComboBox1.Text.ToString.Trim
sqlserverlist.Username = Me.TextBox1.Text.Trim
sqlserverlist.Password = Me.TextBox2.Text.Trim
Me.ComboBox2.Items.AddRange(sqlserverlist.EnumerateSQLServersDatabases())
|
|
|
|
|
use microsoft sqlserver connection info dll files
private static Server srvSql;
private static ServerConnection srvConn;
void ReadDatabase(string _ServerName)
{
try
{
srvConn = new ServerConnection(_ServerName);
srvConn.LoginSecure = true;
srvSql = new Server(srvConn);
foreach (Database MyServer in srvSql.Databases)
{
cmboDB.Items.Add(MyServer.Name);
}
}
catch (Exception DbExp)
{
MessageBox.Show("Error in Connection !!!!", "Database ", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
Check this section
// Log in using SQL authentication instead of Windows authentication
//srvConn.LoginSecure = false;
// Give the login username
//srvConn.Login = txtUsername.Text;
// Give the login password
//srvConn.Password = txtPassword.Text;
Hope it will help you a lot
|
|
|
|
|
|
how can i show a modal window form at a cordinates
im using vb.net 2005 and im doing something like this
dim oForm as new InvoiceForm
with oform
.showmodal()
.left=txtID.left
.top=txtid.top+txtid.height
end with
t.aransiola
|
|
|
|
|
I think this might be what you are looking for
Dim oForm As New InvoiceForm
With oForm
.StartPosition = FormStartPosition.Manual
.Left = txtID.left
.Top = txtid.top+txtid.height
.ShowDialog()
End With
hope it helps
If my help was helpfull let me know, if not let me know why.
The only way we learn is by making mistakes.
|
|
|
|
|
the problem with your code was order of execution. you need to set the left and top before you show the form because execution stops while the form is shown and continues when the form becomes hidden.
|
|
|
|
|
I am using a datetimepicker in my VB 2005 express application
I wan to
Initialize the DTPicker as per the user input
Restrict the min and max values as per user input
Also keep on changing these settings in the application as user is allowed to change/edit input
I tried using can any one please help me with it
I had tried codes like the following
DTPk_reg_day.Value = New Date(Val(cmb_reg_year.Text), cmb_reg_month.SelectedIndex + 1, 1)
is there any provision of NULL value??
DTPk_reg_day.MinDate = New Date(Val(cmb_reg_year.Text), cmb_reg_month.SelectedIndex + 1, 1)
DTPk_reg_day.MaxDate = New Date(Val(cmb_reg_year.Text), cmb_reg_month.SelectedIndex + 1, DTPk_reg_day.Value.MaxValue.Day)
But i am mot successful in achieving all the requirements at the same time
Is there any ways i can also have a NULL value
|
|
|
|
|
nishkarsh_k wrote: Is there any ways i can also have a NULL value
No. A Datetime cannot be null, nor can any of it's parameters.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
The Microsoft DateTimePicker must be given a value type (a DateTime) and therefore can't accept null values. There are a lot of more or less usable solutions to solve this issue, some can be found here on CodeProject. If a commercial solution is an option, I would recommend Smart FieldPackEditor.Net which has been built from the ground up to solve all the DateTimePicker shortcomings.
|
|
|
|
|
I wish to convert an existing column into a comboboxcolumn at run time. I've bound a datasource to a datagridview programmatically using the adapter.Fill(dataset) method. This fills my grid view but I want to change one of the columns, say column 2, to be a combobox column. I know how to do this by adding a new column or by using the designer at design time but neither of these help me. I need to do this programmitically at run time. I'm using VB2005.
I'm trying to restrict the user's entries for this particular column in the database to a simple list.
anyone could give a sample code to do this for me to study?? Please anybody..
|
|
|
|
|
You cannot change a column at runtime. Once the column has been created, that's it. It stays that way for the life of the column. You have to create a new column to replace the old one with.
|
|
|
|
|
hi,,
i want to show checkbox in datagrid, i used DatagridBooleanColumn
& i binded my datatable to datagrid , in my datatable i have a boolean column also.. And the checkbox is showing too.. but it have tri-state. i also tried to change the allownull property of DatagridBooleanColumn to false, but still it have tri-state.. have any idea...
cheers
Sam GCEM Bahrain
|
|
|
|
|
u can try with Template Grid, just add with Check box filed with the template field
|
|
|
|
|
Dear All
Now i about to start to make a Remote desktop software like "GoToMyPC" ..etc
but in LAN where i see the desktop of the remote PC and i can open folders or run programs using a client software in each remote PC
My Ques. How to start such program ??
I don't asking for a whole code just the idea
Indeed the most diff. part , is how to open folders or run programs ?? in other how to send mouse events like click DBclick right click drag ...etc to the remote PC ??
thanks all
bye
|
|
|
|
|
|
well sir
it is just more than captureing its screen , i need to control what i see asif i'm sitting on his PC , for example i can open IE then browse any site and download files (ofcouse to his HD) , well i want to make something like the remote desktop of winXP on LAN
I find someone speak that there is an activex/com for microsoft Remote Desktop
any one has any idea thanks
|
|
|
|