|
I'd say the reason you got a 1 vote is that no-one can understand the question. You want to show a dialog box before printing ? A print dialog, or a dialog you wrote yourself ? In VB6 or VB.NET ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
When I get registry Values in VB.Net there is no problem unless the Value has a space in it. I have tried parenthesis, tick marks, removing the space, referring to it by index, using underscore in place of the space....
This one works:
Bob = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DDM\Device.1", "ModelName", "Empty")
This one does not work:
Bob = My.Computer.Registry.GetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DDM\Device.1", "Rom version", "Empty")
The problem is the space in Rom Version.
Any Ideas?
Ken
|
|
|
|
|
I've never had a problem with it getting a value who's name has spaces in it.
I would suspect that the problem is more with the registry value type though. What registry type is this "Rom Version"?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
You know, I think your right on the money. the two value i have no problem getting are text strings. this one is 4 bytes (52 39 30 32) that when converted to their ascii values = R902, which is right, that is, it is the correct firmware for that drive.
The error message does say - "Conversion from type 'Byte()' to type 'String' is not valid." and
"When casting from a number, the value must be a number less than infinity"
It may just be a coincidence that the Valuename has a space in it and the two the worked did not.
I was planning on getting the value and converting it to ascii.
Thanks for your help!
Ken
(Inventor of the Batch File that will replace VB.NET)
LONG LIVE DOS!! you remember...dos.
|
|
|
|
|
I declared a variable as type Byte and tried that. It said cannot convert from type byte() to type byte which really kinda stumped me. Then I saw that it was an array of bytes (?), right? so I added () to the variable declaration and it works!
Sound right to you or am I going at it completely wrong?
Also, I have to convert these 4 bytes to ascii characters. I'm sure I can figure it out , but do you know of any conversion tools in vb?
Thanks for putting me on the right track!!
Ken
(Inventor of the Batch File that will replace VB.NET)
LONG LIVE DOS!! you remember...dos.
|
|
|
|
|
Ok, I got the ASCII thing too using bob=chr(regvalue(0)).
Thanks again
Ken
(Inventor of the Batch File that will replace VB.NET)
LONG LIVE DOS!! you remember...dos.
|
|
|
|
|
Hello,
I have a set of checkboxes created on a windows form. The state of these need to dynamically set when the form is loading depending on the data coming from the database.
I have tried to use the checkbox.checked and checkbox.CheckState to set the state of the checkboxes, but the state doesnt seem to be remembered. Code as below:
<br />
<br />
ElseIf shelterV.Equals("Quiet South Shelter") Then<br />
selectedShelters.Text = selectedShelters.Text & "Quiet Shouth Shelter" & vbCrLf<br />
log.Message = selectedShelters.Text<br />
log.Category = "Trace"<br />
Logger.Write(log)<br />
QSChkBx.Checked = True<br />
QSChkBx.CheckState = CheckState.Checked<br />
Can anyone please tell me how to set these?
Thanks
|
|
|
|
|
What you're doing is right. There must be other code which is setting the states again.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
mitli wrote: QSChkBx.Checked = True
I think this should read: QSChkBx.Value = vbChecked
...Steve
|
|
|
|
|
Steve Pullan wrote: I think this should read: QSChkBx.Value = vbChecked
Oops... I had a relapse into VB 6.0 Sorry.
...Steve
|
|
|
|
|
I'm having a problem getting a simple "Please Wait..." message to appear while Crystal is generating reports. Is there a simple way to maintain the message on screen until the job is sent to the printer (about 5-10 seconds)?
Thanks for the help.
|
|
|
|
|
Hi,
I am using abit of code to override a datagridcolumn style.
In the onpaint function, the following line draws the text for the cell:
g.DrawString(IIf(Format = "", CType(bVal, String), CType(Strings.Format(bVal, Format), String)), Me.DataGridTableStyle.DataGrid.Font, foreBrush, bounds.X + 2, bounds.Y + 2)
My query is regarding the last 2 parameters, bounds.x+2 and bounds.y + 2
this forces all values in each cell to be drawn left aligned.
Does anyone know a function to calculate the length in pixels of a string?
Then I can right align my cell values by deducting the string length from the cell length.
Any response gratefully appreciated.
Andy
|
|
|
|
|
You can get the width and height of your string via the Graphics.MeasureString() function.
Dim szBuf As System.Drawing.SizeF<br />
szBuf = g.MeasureString("Hello World", Me.DataGridTableStyle.DataGrid.Font)
|
|
|
|
|
Many thanks Joshua,
That solved the problem!
Andy
|
|
|
|
|
Hello,
I have created a report using Crystal Reports 9 in VB.NET.
I'm having trouble with a subreport. I have created a view in SQL server, and a dataset in VB.NET based on that view.
I'm a bit confused by how sub-reports work...
I know that with my main report, I pass the VB form that contains my ReportViewer the dataset I need to populate the data.
Do I need to do the same for subreports?
I went through the process of adding another datasource, but get an error when I create a subreport based on this datasource.
Can someone tell me where to start with this??
Thanks!
Amber
|
|
|
|
|
I have multiple projects in a VB.Net solution. A common module xxx.vb file exists in all the projects of the solution. The code of the xxx.vb is different in each project. When I try to set a break point in xxx.vb in Project B, the break point sets only to the xxx.vb in Project A of VB.Net Solution and not in the project B as expected. Browsing MSDN gave solution for source files with same name within the project only and I tried to change the path in the Breakpoint properties dialog box with vain. Please help to fix the problem.
|
|
|
|
|
This is a bug in the IDE. We have a project with multiple directories where in each directory it's often logical for a web page to have the same name, and the same thing happens. I've yet to find a fix, apart from renaming your classes. If you can create a dummy class for the purpose and put an instance of it in the code you want to debug, you could put a breakpoint in it's constructor and step out.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am new in programming VB .Net and I find problems about building a drawing application.
I've writen a simple application which allows user hand-drawing on a blank form.
However, when the form was minimized, all the drawing was gone.
I searched for a solution in this case and I get two answers.
1) Put the graphic methods in the Form_Paint event.
2) Save the form's image into a bitmap and then reload it as the form is activated.
For the first solution, it works for those drawing which have been recorded already, however I don't think hand-drawing's point data should be saved into an array or datatable for Paint event to repaint the drawing.
For the second solution, I have tried but failed to capture the form's image.
So I want to ask two questions :
1) Is there any VB .Net method that can auto repaint the controls or forms.
2) If no, how to cache the recent control/form image and reload it on to the control/form.
Thanks very much.
-- modified at 6:12 Thursday 3rd November, 2005
|
|
|
|
|
The solution is not first painting into a bitmap and then painting the bitmap in the OnPaoint function.
- Create a new Bitmap of your desired size
- When you need to draw to it use the Graphics.FromImage function to get a Graphics instance (don't forget disposing it after usage).
- override OnPaint and just draw the whole bitmap to the Graphics (DrawImageUnscaled is the fastest) of the event arguments.
|
|
|
|
|
Hi Frens
I have some problem when i use crystal reports in VB.net while passing the parameters dynamically.
I need to know a easy way in vb.net how to pass multi parameters from a form to generate a report.(crystal)
eagerly waiting all the genius people to give me sollution.;)
thanks in advance.
Live Life King Size
Asif
|
|
|
|
|
Hi Frens
I have some problem when i use crystal reports in VB.net while passing the parameters dynamically.
I need to know a easy way in vb.net how to pass multi parameters from a form to generate a report.(crystal)
eagerly waiting all the genius people to give me sollution.;)
thanks in advance.
Live Life King Size
Asif
|
|
|
|
|
I am looking for a classified advertising software which is developed on VB.Net. If you know of one please post it here or Email me.
Thanks
-- modified at 19:50 Wednesday 2nd November, 2005
|
|
|
|
|
What do you want exactly ? An ebay clone ? Banner ads ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Something like ebay clone it does not have to be that sofisticated.
functions will include
1. User logon
2. User will be able to enter ads (text & graphic)
3. To be able to setup multiple categories (Auto, personals, Garden, Boats, ...)
4. search functons
5. Admin functions
6. to be able to Accept credit card payments
7. Take banner ads
8 .....
Thanks
|
|
|
|
|
These boards are for answering questions to do with programming. Your best bet for something like this is a site like Rentacoder. You can get stuff written there pretty cheap. Of course, it will be crap, but it will probably work, so long as you never want to change it.
Christian Graus - Microsoft MVP - C++
|
|
|
|