|
I created a dataset in form1. A button on form1 calls form2. How can I get access to the dataset on form1 while in form2? Thanks for any help provided?
|
|
|
|
|
Read this[^]. It's alittle bit on the VB6 to .NET upgrade, but it also shows you how to pass data between forms.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I am currently trying to read binary values from the windows registry, with the requirement to compare and set a specific option in my program. I have tried using the following: Imports Microsoft.Win32, but have so far failed to read or write binary to the registry. If any one has code or knows how this is possible, your help would be much appreciated.
|
|
|
|
|
Got a sample of the code your using? Also, what's the registry data type you're trying to read and under what key?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
k, at the moment i dont have sample code to read and write binary, thats what i need. However this is the key im trying to use
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Video\{3A293CEE-EFF6-475C-9F1F-730951135E97}\0000
This stores entries for the settings for the NVIDI Gfx settings which im making a tweak tool for, and cant read most of the values as they are binary.
Any help would be appreciated. I can get this working in VB6, but however would rather use .NET as I am able to add Navigation bars and office style buttons.
|
|
|
|
|
First, yoiu should be opening CurrentControlSet, not ControlSet001.
Dim rk As RegistryKey
rk = Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Control\Video\{yada yada yada}\000")
Dim data as Byte() = rk.GetValue("ValueName")
Will return whatever the data for ValueName is in the registry. If you have to return the default value (unnamed) for a key, just use:
Dim data as Byte() = rk.GetValue("")
I think you can figure out how to write the data back.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the reply Dave Kreskowiak, however, this does not work.
What I need to do is read a value from the registry, which may be:
01 00 00 10, then I need that to go to a variable, which I then need to check and change a picturebox.image and listbox.selectedindex, depending on what the value is. Also need to write a specific binary value back to the registry, if the user changes the setting.
The above method just won't work and I'm unsure why.
|
|
|
|
|
I have no idea what your doing wrong because "just doesn't work" doesn't explain what's going on. Does it return Nothing when you call OpenSubKey? If so, then you have the registry path wrong.
This works perfectly on mine:
Dim rk As RegistryKey
rk = Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Control\Video\{3BAC59C8-BD30-404A-9093-F454D23FF17F}\0000")
Dim data As Byte() = rk.GetValue("_Wow.exe:D3DOGL_67207556")
It returns the 4 byte value array of 0x01 0x00 0x00 0x08.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hmm, i'll try with the example of what you did above, can the byte array be output to a label or was it to console.
|
|
|
|
|
So long as you provide the code to do either, yes.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Is it possible for you to email me the form or a small project showing how to do this, or paste the code here. My email is supernorman1@hotmail.com
Thanks for all your help so far
|
|
|
|
|
Dim rk As RegistryKey
rk = Registry.LocalMachine.OpenSubKey("SYSTEM\CurrentControlSet\Control\Video\{3BAC59C8-BD30-404A-9093-F454D23FF17F}\0000")
Dim data As Byte() = rk.GetValue("_Wow.exe:D3DOGL_67207556")
Dim i As Integer
For i = 0 to data.GetUpperBound(0)
TextBox1.Append(String.Format("Value at index {0}: {1}" & Environment.NewLine, i, data(i))
Next
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
... is this possible?
I have a form with a calendar wich a show as modal ... I want to be able to close that form when I click outside ... is this possible?
Is it possible to simulate this behaviour when using a NoModal form?
//Maw
|
|
|
|
|
you could try an event like
Private Sub Form1_MouseLeave(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.MouseLeave
me.close
End Sub
or
Onmouse leave turn modal off then when lostfocus close the form.
have a go with that?
Does my head look big in this!!!!
|
|
|
|
|
Doesn't this defeat the purpose of having a modal form in the first place!?!
Just place a close button on your modal form!
|
|
|
|
|
First off, that defats the purpose of a modal form.
Second, it goes against the normal UI practices followed for Windows. This isn't an intuitive action the users are going to be used to when using Windows.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Welll ....
This is the case ..
I have a textbox and when I hit right-button over it i want to show a calendar. The user must select a date or move outside calendar to close form with calendar. It should work as a normal DatePick-control. On that control, as you know, you can either select or click outside to close calendar. I want to change click to mouseleave-function on my control.
The txtbox is a usercontrol .... I have a form in that usercontrol wich shows the calendar at a position I choose.
Sooo? what do you think?
//Maw
|
|
|
|
|
MaWeRic wrote:
as you know, you can either select or click outside to close calendar. I want to change click to mouseleave-function on my control.
If someone who isn't that good with a mouse uses your control, they're going to get very frustrated because your closing a control that they are having problems keeping a mouse pointer in. Changing this behavior is not recommended. I am one of those people who likes to move a mouse pointer out of the way so I can see an entire control before I click on something.
Microsoft published Official Guidelines for User Interface Developers and Designers[^] for a reason...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Anyone Interested...
Is there a specific methodology or "best practice" for having 2 of your user controls on a single web page communicate information. For example, I have Control A which has printing press information on it and Control B which has press materials information on it. I suppose I could expose many of the press properties Public Shared, however, I don't feel that this is elegant as object oriented programming goes.
Would any one care to suggest some ideas that work for your development practices?
Thank you.
William
|
|
|
|
|
I am using vb.Net 2003. the problem is
I want to open a compose mail page of outlook /outlook express with an attachment of image file. upto now I am succeeded in opening mail with every information like To, From, Bcc,CC, subject, Body.. but Attachment is a problem can any one help me out how to do this ?? the code is
Dim mailMess As String = "mailto:abc@xyz.com"
mailMess = mailMess & "?Subject=Mail from Rizwan"
mailMess = mailMess & "&Body=This is the sample text"
mailMess = mailMess & "&attachment=C:\Connection.txt"
System.Diagnostics.Process.Start(mailMess)
this opens fine but attachment never comes... I tried the word Attach as well but no result..
note: I have implemented this with outlook reference library. but dont want to use that as I had problem when client is using any other version of outlook ...
any solution will be highly appreciated..
|
|
|
|
|
I seem to remember reading somewhere that attachment from the command line are not supported. I'm trying to find where I saw this, but it's been a long time...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
stop searching for that line.. I trust your words..
thanks
|
|
|
|
|
Hi all,
I am making a usercontrol but i would like it to make its background colour transparent?
Does anyone know how to do this?
i would like the background colour to be transperent when the control is moved as well, so it does not affect other controls on the form
this is my code so far.....
Public Class MyTransparentControl
Inherits UserControl
Protected Overrides Sub OnPaint(ByVal e As Windows.Forms.PaintEventArgs)
Dim myPath As New System.Drawing.Drawing2D.GraphicsPath
Dim myGraphics As Graphics = e.Graphics
Dim myPen As New Pen(Color:=Me.ForeColor, Width:=2)
Me.Size = New Size(100, 100)
myPath.AddLine(0, 0, 100, 0)
myPath.AddLine(100, 0, 100, 100)
myPath.AddLine(100, 100, 0, 100)
myPath.AddLine(0, 100, 0, 0)
myGraphics.DrawPath(Pen:=myPen, path:=myPath)
End Sub
End Class
Dont forget to rock and roll this summer!
|
|
|
|
|
|
help me...
I have some troubles with M.Access. I want to create the calendar control on a form of my Access database like the calendar control of vb.net or C#. However, I can't find the way to do that .Thus, I'm very happy if you help me...
|
|
|
|