|
In VB6 code?! Yikes! You're looking at a very rough time doing this.
The problem with Injection is that your code is injected into the Process. You're still not running on the proper thread to call the function. There's just no way to do it that's using any documented methods.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
how i chang culture in control panel in runtime in my program
I WANT chang clender type and short date format
22222222222
-- modified at 8:38 Sunday 22nd January, 2006
|
|
|
|
|
Unless your writing a utility to specifically do this and nothign else, you have no business doin this.
Remember, your app is running on a SHARED system. That means your app has to work and play nice with other applications. Changing system-wide settings to overcome deficiencies in your code is just extremely bad practice.
There is no reason to change the culture or short date format in the system. Your code can do anything required by this change itself, if written correctly.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello everyone,
My problem is regarding the conversion of tiff JPEG compression image to LZW. Infact, i know that how can i convert the compressions of tiff image. But the JPEG compression tiff image is the only one which doesn't load in the system.drawing.image class.
Can anyone help me that how can i convert the tiff JPEG compression image to other compression.
Waiting...
|
|
|
|
|
Hi Guys,
If we have a password for the windows (for example), when we try to write the pass, if we had the Caps-Lock Button active, we see a message in a yellow "box", to inform as for this active button, which can make problems in our password!
In one of my programs, I ask somewhere for a password..so I want to show this message to the user,
if his keyboard has the Caps Button active...
I must use tooltip?
Please, give me a solution (with some lines of code if its possible and necessary)
Thanx in advance...
|
|
|
|
|
Why does everyone come around wanting pre-written code all the time?
A simple Google search for "vb.net capslock" comes up with an example here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Sorry, but I am beginner...and I dont understand this exaple and its use..Can you help me more?
|
|
|
|
|
All the examples are going to be just like this. They all have to make calls directly in the Win32 API to get the current status of the lock keys, CapsLock, NumLock, and ScrollLock.
Your best understanding is going to be putting your code together and calling one of the functions, such as GetLockStatus, and step through the code in the debugger.
In the posted example, all you need to worry about calling is GetLockStatus.
Dim status As Boolean
status = GetLockStatus(ToggleKey.CapsLock)
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanx Dave Kreskowiak..now I understand! Before, I have problems with the returning value of function (I didnt understand that its boolean) and the way of calling!
And I use google as good as I can..I try.. Thanks again..
|
|
|
|
|
I want the VB.net code for capture of an image taken by a web camera.
-Shonan Vora
|
|
|
|
|
If you're just going to post a demand for code, a Google[^] search for "capture webcam image vb.net" is your next stop.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
-- modified at 10:28 Sunday 22nd January, 2006
|
|
|
|
|
Hi ,
I am sending "MyReport" direct to printer using .NET 2003
//////////////////////////////////////
Dim crobj as New rptMyReport
crobj.PrintToPrinter(1, False, 0, 0)
////////////////////////////////////////////
I need to get the total page count in this case.
I need immediate response.
Thanks
Madni Abbasi
|
|
|
|
|
I have a user control which includes a Datagrid that needs one column for each hour of the day for five categories... so my datagrid would have 5 rows and 25 columns. The 1st column is the category name and is no problem. Columns 2-25 store the hourly figures and what I want to do is use a custom DataGridColumnStyle on these but when I try to cast the DataGridTaleStyles.GridColumnStyles for each of these columns to my custom DataGridColumnStyle it gives me an invalid cast error.
Since that's probably as clear as mud here's the code I have:
Public Class vbsDataGridTextBoxColumn
Inherits System.Windows.Forms.DataGridTextBoxColumn
Public Sub New()
'This is just to get it working - we'll set more properties later.
Me.Alignment = HorizontalAlignment.Right
Me.TextBox.MaxLength = 6
Me.Width = 50
End Sub
End Class
That's the custom Column Style (we'll set more properties later)... and here is the method that runs in the user control to change column types on the fly as the DataGrid is populated. (We need to do this as the DataGrid can switch from being editable or not depending on which day's data is being edited) I've commented the line in red that throws the exception.
Private Sub vbsDataGrid_DataSourceChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles vbsDataGrid.DataSourceChanged
Dim i As Int32 = 0
Dim cm As CurrencyManager = Me.BindingContext(Me.vbsDataGrid.DataSource)
Dim ts As New DataGridTableStyle
ts.MappingName = DirectCast(cm.List, DataView).Table.TableName
'Make the dataGrid use our new tablestyle and bind it to our table
Me.vbsDataGrid.TableStyles.Clear()
Me.vbsDataGrid.TableStyles.Add(ts)
'Now create a ColumnStyle for each of the hourly figure columns (1-24) in the datagrid using our custom class. Note the first column (0) doesn't need a custom style.
Dim tbc As New vbsDataGridTextBoxColumn
For i = 1 To 24
'***THIS IS WHERE I GET AN INVALID CAST ERROR***
tbc = CType(ts.GridColumnStyles(i), vbsDataGridTextBoxColumn)
tbc.HeaderText = "Hour " & i.ToString()
Next
End If
End Sub
Anyone know why this would happen? If I create 'tbc' as a normal DataGridTextBoxColumn the cast has no problem - it's only when I use my custom DataGridTextBoxColumn class I get the error.
Hope someone can help - I'm darned if I know what's going on!
Mike
|
|
|
|
|
I think you're looking for something more like:
For i = 1 to 24
ts.GridColumnStyles(i).HeaderText = String.Format("Hour {0}", i)
Next
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave,
I may have missed your point but the line it's falling over on is the one above - where I cast each GridColumnStyle in my 24 columns to my custom DataGridTextBoxColumn object - this line:
tbc = CType(ts.GridColumnStyles(i), vbsDataGridTextBoxColumn)
I don't understand why it falls over on this line since my custom column style is inherited from a DataGridTextBoxColumn and I can cast ts.GridColumnStyles(i) to a normal DataGridTextBoxColumn object without a problem - it should surely work.
Have I missed something here?
Cheers,
Mike
-- modified at 1:44 Monday 23rd January, 2006
|
|
|
|
|
You might want to do something like this to debug it
For i = 1 to 24
Console.Writeline( String.Format("Index {0} is a {1}", i, ts.GridColumnStyles(i).GetType().FullName) )
Next i
and see what your actually trying to cast to your custom TextBoxColumn.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
directory class and directoryinfo call, even the file class and the other related class didn't help me.
my problem is: how to call a file exist in the system folder?
what i mean...how can i get the system root of the current os.
in the normal way we can use %systemroot%....
but writing like this way as a path give an exeption.
so how can i get the system root of the current machine???
thanx..
Militiaware
Faris Madi
|
|
|
|
|
%SystemRoot% is an environment variable.
If you want the path to the System Folder, use the Environment class, GetFolderPath[^] method to return the path. An example is on the page in the link.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
If I understand your question this will help you:
Dim temp as string
temp = System.IO.Path.GetFullPath("example.jpg")
'temp = "C:\..directory of your .exe..\example.jpg"
in the position of ("exaple.jpg") you can write everything but no ("")
|
|
|
|
|
if i got the IP address of some one.
how can i get the location of it.
because i know the first bits ex: 120.193 refer to the network...
so can i at least get where is that network located ?
Militiaware
Faris Madi
|
|
|
|
|
No, not accurately at least. About the best you can do is get to a region of a state or small country.
IP Addresses are assigned arbitrarily without reguard to a physical location.
Read this[^] for a little explanation.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I Have a menu, and a set of categories in a database table.
For each of the categories, I'm generating some menuitems at runtime.
Because the total amount can vary, the menuitems are generated in a loop, thus not defined globally in the class, IE:
<br />
Private Sub SetupMenus()<br />
<br />
Dim myItem as MenuItem<br />
<br />
For i as integer = 0 to datatable.Rows.Count -1<br />
myItem = new MenuItem<br />
myItem.Text = datatable.Rows(i).Item("CategoryName")<br />
Next<br />
<br />
End Sub
But if the menuitems are generated at runtime, then how do I generate an OnClick event for them and point it to a procedure?
Any response gratefully appreciated.
Andy
|
|
|
|
|
Create an EventHandler for the procedure, and add it to the Click event of the item.
---
b { font-weight: normal; }
|
|
|
|
|
So what line of code do I need to add to the code above?
I know in C#, its something like myItem.OnClick = new EventHandler(....)
But that doesnt work in VB.Net
|
|
|
|
|
You're looking for AddHandler[^] and RemoveHandler[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|